[PATCH] D119094: [clang] Don't emit redundant warnings for 'return;'
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 7 00:00:46 PST 2022
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.
Makes sense to me, thanks!
================
Comment at: clang/lib/Sema/SemaStmt.cpp:4102
+ if (FD->isInvalidDecl()) {
+ // Don't redundantly warn about "return;" if the return type is invalid.
+ } else if (getLangOpts().CPlusPlus11 && FD && FD->isConstexpr()) {
----------------
The comment in the test helped me understand this case better. I'd find "(The intended return type may have been void)" a useful hint here.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119094/new/
https://reviews.llvm.org/D119094
More information about the cfe-commits
mailing list