[clang] [Clang][C++23] Implement P2448R2: Relaxing some constexpr restrictions (PR #77753)
Mariya Podchishchaeva via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 11 04:11:36 PST 2024
================
@@ -423,13 +423,13 @@ namespace dr1359 { // dr1359: 3.5
#if __cplusplus >= 201103L
union A { constexpr A() = default; };
union B { constexpr B() = default; int a; }; // #dr1359-B
- // cxx11-17-error at -1 {{defaulted definition of default constructor is not constexpr}}
+ // cxx11-17-error at -1 {{defaulted definition of default constructor that marked constexpr but never produces a constant expression is a C++23 extension}}
----------------
Fznamznon wrote:
Same, In C++20 mode such constructor is considered as a valid and producing constexpr due to https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1331r2.pdf , so no extension warning there.
https://github.com/llvm/llvm-project/pull/77753
More information about the cfe-commits
mailing list