We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf0e0f1 commit 568174cCopy full SHA for 568174c
lib/Sema/CSDiagnostics.cpp
@@ -6203,6 +6203,19 @@ void SkipUnhandledConstructInResultBuilderFailure::diagnosePrimary(
6203
}
6204
6205
if (auto stmt = unhandled.dyn_cast<Stmt *>()) {
6206
+ if (auto *switchStmt = getAsStmt<SwitchStmt>(stmt)) {
6207
+ auto caseStmts = switchStmt->getCases();
6208
+ if (caseStmts.empty())
6209
+ return;
6210
+ }
6211
+
6212
+ // Empty case statements are diagnosed by parser.
6213
+ if (auto *caseStmt = getAsStmt<CaseStmt>(stmt)) {
6214
+ auto *body = caseStmt->getBody();
6215
+ if (body->getNumElements() == 0)
6216
6217
6218
6219
emitDiagnostic(asNote ? diag::note_result_builder_control_flow
6220
: diag::result_builder_control_flow,
6221
builder->getName());
0 commit comments