Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: enable C++20 on Apple Clang #6858

Merged
merged 1 commit into from Apr 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions conans/client/build/cppstd_flags.py
Expand Up @@ -118,6 +118,10 @@ def _cppstd_apple_clang(clang_version, cppstd):
v17 = "c++17"
vgnu17 = "gnu++17"

if Version(clang_version) >= "10.0":
v20 = "c++2a"
vgnu20 = "gnu++2a"

flag = {"98": v98, "gnu98": vgnu98,
"11": v11, "gnu11": vgnu11,
"14": v14, "gnu14": vgnu14,
Expand Down
3 changes: 3 additions & 0 deletions conans/test/unittests/client/build/cpp_std_flags_test.py
Expand Up @@ -172,9 +172,12 @@ def test_apple_clang_cppstd_flags(self):
self.assertEqual(_make_cppstd_flag("apple-clang", "9.1", "11"), '-std=c++11')
self.assertEqual(_make_cppstd_flag("apple-clang", "9.1", "14"), '-std=c++14')
self.assertEqual(_make_cppstd_flag("apple-clang", "9.1", "17"), "-std=c++17")
self.assertEqual(_make_cppstd_flag("apple-clang", "9.1", "20"), None)

self.assertEqual(_make_cppstd_flag("apple-clang", "10.0", "17"), "-std=c++17")
self.assertEqual(_make_cppstd_flag("apple-clang", "10.0", "20"), "-std=c++2a")
self.assertEqual(_make_cppstd_flag("apple-clang", "11.0", "17"), "-std=c++17")
self.assertEqual(_make_cppstd_flag("apple-clang", "11.0", "20"), "-std=c++2a")

def test_apple_clang_cppstd_defaults(self):
self.assertEqual(_make_cppstd_default("apple-clang", "2"), "gnu98")
Expand Down