[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 10 10:53:49 PDT 2024


================
@@ -70,8 +108,14 @@ NamedDecl *Parser::ParseCXXInlineMethodDef(
                       ? diag::warn_cxx98_compat_defaulted_deleted_function
                       : diag::ext_defaulted_deleted_function)
         << 1 /* deleted */;
-      Actions.SetDeclDeleted(FnD, KWLoc);
+      StringLiteral *Message = ParseCXXDeletedFunctionMessage();
+      Actions.SetDeclDeleted(FnD, KWLoc, Message);
       Delete = true;
+      if (Message)
+        Diag(Message->getBeginLoc(), getLangOpts().CPlusPlus26
----------------
Sirraide wrote:

Oh yeah, that makes a lot more sense; I have no idea why I didn’t put it there candidly.

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


More information about the cfe-commits mailing list