[clang] [Clang][Parser] Accept P2741R3 (static_assert with user-generated message) in C++11 as an extension (PR #102044)
Nikolas Klauser via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 6 05:42:25 PDT 2024
================
@@ -671,10 +671,8 @@ static void InitializeCPlusPlusFeatureTestMacros(const LangOptions &LangOpts,
LangOpts.CPlusPlus23 ? "202211L"
: LangOpts.CPlusPlus17 ? "201603L"
: "200907");
- Builder.defineMacro("__cpp_static_assert", LangOpts.CPlusPlus26 ? "202306L"
- : LangOpts.CPlusPlus17
- ? "201411L"
- : "200410");
+ // C++17 / C++26 static_assert backported
+ Builder.defineMacro("__cpp_static_assert", "202306L");
----------------
philnik777 wrote:
I'm not exactly sure what's ambiguous here. You say yourself that it specifies what the value should be for a given standards version. I also can't find anything suggesting that implementations are allowed to define then to something else. Anyways, since we seem to agree that implementations should be allowed to define them to some higher number, I'm not sure it makes a ton of sense to do anything other than filing an issue. But where should it be filed? Is that core wording or library? Both? Neither?
https://github.com/llvm/llvm-project/pull/102044
More information about the cfe-commits
mailing list