[clang] [clang][Sema] Combine fallout warnings to just one warning (PR #127546)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 18 09:20:46 PST 2025
================
@@ -588,42 +579,26 @@ struct CheckFallThroughDiagnostics {
static CheckFallThroughDiagnostics MakeForCoroutine(const Decl *Func) {
CheckFallThroughDiagnostics D;
D.FuncLoc = Func->getLocation();
- D.diag_MaybeFallThrough_HasNoReturn = 0;
- D.diag_MaybeFallThrough_ReturnsNonVoid =
- diag::warn_maybe_falloff_nonvoid_coroutine;
- D.diag_AlwaysFallThrough_HasNoReturn = 0;
- D.diag_AlwaysFallThrough_ReturnsNonVoid =
- diag::warn_falloff_nonvoid_coroutine;
+ D.diag_FallThrough_HasNoReturn = 0;
+ D.diag_FallThrough_ReturnsNonVoid = diag::warn_falloff_nonvoid;
D.diag_NeverFallThroughOrReturn = 0;
D.funMode = Coroutine;
return D;
}
static CheckFallThroughDiagnostics MakeForBlock() {
CheckFallThroughDiagnostics D;
- D.diag_MaybeFallThrough_HasNoReturn =
- diag::err_noreturn_block_has_return_expr;
- D.diag_MaybeFallThrough_ReturnsNonVoid =
- diag::err_maybe_falloff_nonvoid_block;
- D.diag_AlwaysFallThrough_HasNoReturn =
- diag::err_noreturn_block_has_return_expr;
- D.diag_AlwaysFallThrough_ReturnsNonVoid =
- diag::err_falloff_nonvoid_block;
+ D.diag_FallThrough_HasNoReturn = diag::err_noreturn_block_has_return_expr;
----------------
Sirraide wrote:
Actually, now that I’m taking another look at this, could we merge these invalid-noreturn warnings into a single diagnostic as well?
https://github.com/llvm/llvm-project/pull/127546
More information about the cfe-commits
mailing list