================
@@ -1473,7 +1475,7 @@ Decl *Parser::ParseFunctionDefinition(ParsingDeclarator 
&D,
   D.getMutableDeclSpec().abort();
 
   if (BodyKind != Sema::FnBodyKind::Other) {
-    Actions.SetFunctionBodyKind(Res, KWLoc, BodyKind);
+    Actions.SetFunctionBodyKind(Res, KWLoc, BodyKind, DeletedMessage);
----------------
Sirraide wrote:

So after looking into this a bit, I don’t think we want to do that because 
`Res` is not a `FunctionDecl*` here, it’s a `Decl*`. Specifically, it could 
also be a template, which means we’d need to first dig out the actual function 
using `Sema::AdjustDeclIfTemplate`; the same is also true in at least one other 
place. `SetFunctionBodyKind` calls `SetDeclDeleted`, which already takes care 
of all of that, so I think it’d make more sense to put that there (however, a 
`setDeletedMessage()` on `FunctionDecl` is still useful, and I’ll still be 
using that in other places).

https://github.com/llvm/llvm-project/pull/86526
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to