Skip to content

Commit

Permalink
gcc 5 support of std c++17 (#9431)
Browse files Browse the repository at this point in the history
* gcc 5 support of std c++17

* simplify comparisson
  • Loading branch information
lasote committed Aug 20, 2021
1 parent 3e1d007 commit 4a9b65f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion conan/tools/_compilers.py
Expand Up @@ -302,7 +302,7 @@ def _cppstd_gcc(gcc_version, cppstd):
v14 = "c++1y"
vgnu14 = "gnu++1y"

if Version(gcc_version) >= "5.1":
if Version(gcc_version) >= "5":
v17 = "c++1z"
vgnu17 = "gnu++1z"

Expand Down
2 changes: 1 addition & 1 deletion conans/client/build/cppstd_flags.py
Expand Up @@ -253,7 +253,7 @@ def _cppstd_gcc(gcc_version, cppstd):
v14 = "c++1y"
vgnu14 = "gnu++1y"

if Version(gcc_version) >= "5.1":
if Version(gcc_version) >= "5":
v17 = "c++1z"
vgnu17 = "gnu++1z"

Expand Down
3 changes: 2 additions & 1 deletion conans/test/unittests/client/build/cpp_std_flags_test.py
Expand Up @@ -52,7 +52,8 @@ def test_gcc_cppstd_flags(self):
self.assertEqual(_make_cppstd_flag("gcc", "5", "11"), '-std=c++11')
self.assertEqual(_make_cppstd_flag("gcc", "5", "14"), '-std=c++14')
self.assertEqual(_make_cppstd_flag("gcc", "5", "gnu14"), '-std=gnu++14')
self.assertEqual(_make_cppstd_flag("gcc", "5", "17"), None)
self.assertEqual(_make_cppstd_flag("gcc", "5", "17"), '-std=c++1z')
self.assertEqual(_make_cppstd_flag("gcc", "5", "gnu17"), '-std=gnu++1z')

self.assertEqual(_make_cppstd_flag("gcc", "5.1", "11"), '-std=c++11')
self.assertEqual(_make_cppstd_flag("gcc", "5.1", "14"), '-std=c++14')
Expand Down

0 comments on commit 4a9b65f

Please sign in to comment.