Repository: mesonbuild/meson

Issue:
Support cpp_std=c++2a and cpp_std=gnu++2a
The latest versions of both clang and gcc support these flags.


Discussion:

Resolving patch:
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -80,8 +80,8 @@ def __init__(self, exelist, version, cltype, is_cross, exe_wrapper=None, **kwarg
     def get_options(self):
         opts = CPPCompiler.get_options(self)
         opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
-                                                         ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z',
-                                                          'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z'],
+                                                         ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a',
+                                                          'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'],
                                                          'none')})
         return opts
 
@@ -139,8 +139,8 @@ def __init__(self, exelist, version, gcc_type, is_cross, exe_wrap, defines, **kw
     def get_options(self):
         opts = CPPCompiler.get_options(self)
         opts.update({'cpp_std': coredata.UserComboOption('cpp_std', 'C++ language standard to use',
-                                                         ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z',
-                                                          'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z'],
+                                                         ['none', 'c++98', 'c++03', 'c++11', 'c++14', 'c++17', 'c++1z', 'c++2a',
+                                                          'gnu++03', 'gnu++11', 'gnu++14', 'gnu++17', 'gnu++1z', 'gnu++2a'],
                                                          'none'),
                      'cpp_debugstl': coredata.UserBooleanOption('cpp_debugstl',
                                                                 'STL debug mode',
diff --git a/run_unittests.py b/run_unittests.py
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -3111,7 +3111,13 @@ def _test_stds_impl(self, testdir, compiler, p):
         for v in compiler.get_options()[lang_std].choices:
             if (compiler.get_id() == 'clang' and '17' in v and
                 (version_compare(compiler.version, '<5.0.0') or
-                 (compiler.clang_type == mesonbuild.compilers.CLANG_OSX and version_compare(compiler.version, '<9.2')))):
+                 (compiler.clang_type == mesonbuild.compilers.CLANG_OSX and version_compare(compiler.version, '<9.1')))):
+                continue
+            if (compiler.get_id() == 'clang' and '2a' in v and
+                (version_compare(compiler.version, '<6.0.0') or
+                 (compiler.clang_type == mesonbuild.compilers.CLANG_OSX and version_compare(compiler.version, '<9.1')))):
+                continue
+            if (compiler.get_id() == 'gcc' and '2a' in v and version_compare(compiler.version, '<8.0.0')):
                 continue
             std_opt = '{}={}'.format(lang_std, v)
             self.init(testdir, ['-D' + std_opt])


Test patch: