Skip to content

Commit dcb489c

Browse files
committed
Add MSVC configuration with /Zc:__cppstd set to c++20
Demonstrate bug #343 - since MSVC offers individual options to control /std:c++20, /Zc:__cplusplus, and /Zc:preprocessor, it's possible to have a combination where the compiler is in C++20 mode (and says so), but the traditional preprocessor (which not support __VA_OPT__) is in use. This configuration is commonly trigged by Qt6, which requires c++17, suggests c++20, sets /Zc:__cpluspls (so it can #ifdef based on compiler), but doesn't care about the preprocessor. MSVC still doesn't enable the new /Zc:preprocessor by default, even with /std:c++20 or /permissive-.
1 parent eaeb89c commit dcb489c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

.github/workflows/ci.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1675,6 +1675,13 @@ jobs:
16751675
cc: "cl", cxx: "cl",
16761676
cxx_standard: 20,
16771677
}
1678+
- {
1679+
name: "Windows MSVC 2022 C++20 __cppstd",
1680+
os: windows-2022,
1681+
cc: "cl", cxx: "cl",
1682+
cxx_standard: 20,
1683+
cxx_flags: "/Zc:__cplusplus"
1684+
}
16781685
- {
16791686
name: "Windows MSVC 2022 C++20 preprocessor",
16801687
os: windows-2022,
@@ -1729,6 +1736,13 @@ jobs:
17291736
cc: "cl", cxx: "cl",
17301737
cxx_standard: 20,
17311738
}
1739+
- {
1740+
name: "Windows MSVC 2019 C++20 __cppstd",
1741+
os: windows-2019,
1742+
cc: "cl", cxx: "cl",
1743+
cxx_standard: 20,
1744+
cxx_flags: "/Zc:__cplusplus"
1745+
}
17321746
- {
17331747
name: "Windows MSVC 2019 C++20 preprocessor",
17341748
os: windows-2019,

0 commit comments

Comments
 (0)