[clang] [Clang] [C++26] Implement P2573R2: `= delete("should have a reason");` (PR #86526)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 28 14:12:15 PDT 2024
================
@@ -18157,7 +18158,7 @@ void Sema::SetDeclDeleted(Decl *Dcl, SourceLocation DelLoc) {
// C++11 [dcl.fct.def.delete]p4:
// A deleted function is implicitly inline.
Fn->setImplicitlyInline();
- Fn->setDeletedAsWritten();
+ Fn->setDeletedWithMessage(Message);
----------------
Sirraide wrote:
> I think we should just add the Message as parameter to `setDeletedAsWritten`
I don’t think that would work too well after all now that the message is stored in the `DefaultFunctionInfo`, because `setDeletedAsWritten()` is called in many places, but the `DefaultFunctionInfo` needs to be constructed separately in some. Currently, there is only one place where `setDeletedAsWritten()` is called and then immediately after `setDeletedMessage()`, so I don’t thing it’s worth merging the two.
https://github.com/llvm/llvm-project/pull/86526
More information about the cfe-commits
mailing list