[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Feb 19 09:09:58 PST 2025
================
@@ -3590,7 +3590,8 @@ StmtResult Sema::ActOnCapScopeReturnStmt(SourceLocation ReturnLoc,
if (auto *CurBlock = dyn_cast<BlockScopeInfo>(CurCap)) {
if (CurBlock->FunctionType->castAs<FunctionType>()->getNoReturnAttr()) {
- Diag(ReturnLoc, diag::err_noreturn_block_has_return_expr);
+ Diag(ReturnLoc, diag::err_noreturn_has_return_expr)
+ << diag::FunModes::Block;
return StmtError();
----------------
Sirraide wrote:
The issue with that is that there are other kinds of ‘functions’ that this diagnostic doesn’t care about, e.g. ObjCMethods, some diagnostics might want to call member functions ‘methods’ instead etc. etc. It’s better to give it a more specific name imo because at least at the moment the primary use case for it is all of thse falloff-related diagnostics
https://github.com/llvm/llvm-project/pull/127546
More information about the cfe-commits
mailing list