[clang] [Clang] Implement P2747 constexpr placement new (PR #104586)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 21 07:13:39 PDT 2024


================
@@ -245,7 +245,7 @@ namespace std {
 namespace PlacementNew {
   constexpr int foo() { // both-error {{never produces a constant expression}}
     char c[sizeof(int)];
-    new (c) int{12}; // ref-note {{call to placement 'operator new'}} \
+    new (c) int{12}; // ref-note {{this placement new expression is not yet supported in constant expressions}} \
----------------
AaronBallman wrote:

Ohhhhhhhhh yeah, it would be better if we could have a more clear diagnostic as the current wording sounds like "we'll get around to it someday" and not "because the language mode isn't new enough".

https://github.com/llvm/llvm-project/pull/104586


More information about the cfe-commits mailing list