diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/spack/compilers/gcc.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/spack/spack/compilers/gcc.py b/lib/spack/spack/compilers/gcc.py index ae8d5aa97e..adef8a8277 100644 --- a/lib/spack/spack/compilers/gcc.py +++ b/lib/spack/spack/compilers/gcc.py @@ -100,6 +100,28 @@ class Gcc(spack.compiler.Compiler): return "-std=c++17" @property + def cxx20_flag(self): + if self.real_version < Version("8.0"): + raise spack.compiler.UnsupportedCompilerFlag( + self, "the C++20 standard", "cxx20_flag", "< 8.0" + ) + elif self.real_version < Version("11.0"): + return "-std=c++2a" + else: + return "-std=c++20" + + @property + def cxx23_flag(self): + if self.real_version < Version("11.0"): + raise spack.compiler.UnsupportedCompilerFlag( + self, "the C++23 standard", "cxx23_flag", "< 11.0" + ) + elif self.real_version < Version("14.0"): + return "-std=c++2b" + else: + return "-std=c++23" + + @property def c99_flag(self): if self.real_version < Version("4.5"): raise spack.compiler.UnsupportedCompilerFlag( |