================ @@ -717,6 +717,13 @@ bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) { return false; } + if (const FunctionDecl *CalleeDecl = CE->getDirectCallee(); + CalleeDecl && CalleeDecl->hasAttr<NotTailCalledAttr>()) { + Diag(St->getBeginLoc(), diag::err_musttail_mismatch) << /*show-function-callee=*/true << CalleeDecl; + Diag(CalleeDecl->getLocation(), diag::note_musttail_disabled_by_not_tail_called) << CalleeDecl; ---------------- erichkeane wrote:
```suggestion Diag(CalleeDecl->getLocation(), diag::note_musttail_disabled_by_not_tail_called); ``` You don't need the `<< CalleeDecl` since that is how we fill in the `%0` type things in the diagnostic kinds message. Since the added one doesn't have one, Aaron suggested instead of this diagnostic to reuse an existing one in a previous comment which I'm OK with (though I'm also ok with this one). I'll let Aaron decide if he feels strongly enough to revert to the other one. https://github.com/llvm/llvm-project/pull/134465 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits