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

fix cppstd checks for c++26 in newer compiler versions #17250

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions conan/tools/build/cppstd.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,14 @@ def _apple_clang_supported_cppstd(version):
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17"]
if version < "13.0":
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20"]
# https://github.com/conan-io/conan/pull/17092 doesn't show c++23 full support until 16
# but it was this before Conan 2.9, so keeping it to not break
if version < "16.0":
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20",
"23", "gnu23"]

return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20", "23", "gnu23"]
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20", "23", "gnu23",
"26", "gnu26"]


def _gcc_supported_cppstd(version):
Expand All @@ -184,8 +190,13 @@ def _gcc_supported_cppstd(version):
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17"]
if version < "11":
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20"]
# https://github.com/conan-io/conan/pull/17092
if version < "14.0":
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20",
"23", "gnu23"]

return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20", "23", "gnu23"]
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20", "23", "gnu23",
"26", "gnu26"]


def _msvc_supported_cppstd(version):
Expand Down Expand Up @@ -222,8 +233,12 @@ def _clang_supported_cppstd(version):
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17"]
if version < "12":
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20"]

return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20", "23", "gnu23"]
# https://github.com/conan-io/conan/pull/17092
if version < "17.0":
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20",
"23", "gnu23"]
return ["98", "gnu98", "11", "gnu11", "14", "gnu14", "17", "gnu17", "20", "gnu20", "23", "gnu23",
"26", "gnu26"]


def _mcst_lcc_supported_cppstd(version):
Expand Down
11 changes: 11 additions & 0 deletions test/integration/configuration/test_profile_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ def test_remove_plugin_file(self):
c.run("profile show", assert_error=True)
assert "ERROR: The 'profile.py' plugin file doesn't exist" in c.out

def test_regresion_29(self):
# https://github.com/conan-io/conan/issues/17247
c = TestClient()
c.save({"conanfile.txt": ""})
c.run("install . -s compiler=clang -s compiler.version=19 -s compiler.cppstd=26")
# doesn't fail anymore
c.run("install . -s compiler=apple-clang -s compiler.version=16 -s compiler.cppstd=26")
# doesn't fail anymore
c.run("install . -s compiler=gcc -s compiler.version=14 -s compiler.cppstd=26")
# doesn't fail anymore


def test_android_ndk_version():
c = TestClient()
Expand Down