summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Pavel <rspavel@lanl.gov>2022-05-07 10:09:20 -0700
committerGitHub <noreply@github.com>2022-05-07 13:09:20 -0400
commit5ab526185ac0ceab31d1f9039f1c79e42b7b7f26 (patch)
tree29f847ce744392d0c3e6a5ec073817995a4bf82e /lib
parent654a07d642dc7403c62abab0124dda09f2a07264 (diff)
downloadspack-5ab526185ac0ceab31d1f9039f1c79e42b7b7f26.tar.gz
spack-5ab526185ac0ceab31d1f9039f1c79e42b7b7f26.tar.bz2
spack-5ab526185ac0ceab31d1f9039f1c79e42b7b7f26.tar.xz
spack-5ab526185ac0ceab31d1f9039f1c79e42b7b7f26.zip
Force GCC to always provide a C++14 flag (#29781)
* Force GCC to always provide a C++14 flag Updated gnu logic so that the c++14 flag for g++ is always propagated. This fixes issues with build systems that error out if passed an empty string for a flag. Engaging in the best kind of software engineering by updating the unit test to pass with the value it is now passed. This should better match the expected flag for g++ compiling with the C++14 standard
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/gcc.py4
-rw-r--r--lib/spack/spack/test/compilers/basics.py2
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/spack/spack/compilers/gcc.py b/lib/spack/spack/compilers/gcc.py
index 60c4a75978..40794103f6 100644
--- a/lib/spack/spack/compilers/gcc.py
+++ b/lib/spack/spack/compilers/gcc.py
@@ -78,10 +78,8 @@ class Gcc(spack.compiler.Compiler):
self, "the C++14 standard", "cxx14_flag", "< 4.8")
elif self.real_version < ver('4.9'):
return "-std=c++1y"
- elif self.real_version < ver('6.0'):
- return "-std=c++14"
else:
- return ""
+ return "-std=c++14"
@property
def cxx17_flag(self):
diff --git a/lib/spack/spack/test/compilers/basics.py b/lib/spack/spack/test/compilers/basics.py
index 7610280123..4d4794663d 100644
--- a/lib/spack/spack/test/compilers/basics.py
+++ b/lib/spack/spack/test/compilers/basics.py
@@ -501,7 +501,7 @@ def test_gcc_flags():
unsupported_flag_test("cxx14_flag", "gcc@4.7")
supported_flag_test("cxx14_flag", "-std=c++1y", "gcc@4.8")
supported_flag_test("cxx14_flag", "-std=c++14", "gcc@4.9")
- supported_flag_test("cxx14_flag", "", "gcc@6.0")
+ supported_flag_test("cxx14_flag", "-std=c++14", "gcc@6.0")
unsupported_flag_test("cxx17_flag", "gcc@4.9")
supported_flag_test("cxx17_flag", "-std=c++1z", "gcc@5.0")
supported_flag_test("cxx17_flag", "-std=c++17", "gcc@6.0")