diag::err_noreturn_block_has_return_expr;
D.diag_AlwaysFallThrough_ReturnsNonVoid =
diag::err_falloff_nonvoid_block;
- D.diag_NeverFallThroughOrReturn =
- diag::warn_suggest_noreturn_block;
+ D.diag_NeverFallThroughOrReturn = 0;
D.funMode = Block;
return D;
}
}
// For blocks / lambdas.
- return ReturnsVoid && !HasNoReturn
- && ((funMode == Lambda) ||
- D.getDiagnosticLevel(diag::warn_suggest_noreturn_block, FuncLoc)
- == DiagnosticsEngine::Ignored);
+ return ReturnsVoid && !HasNoReturn;
}
};
int j;
void test1() { // expected-warning {{function 'test1' could be declared with attribute 'noreturn'}}
- ^ (void) { while (1) { } }(); // expected-warning {{block could be declared with attribute 'noreturn'}}
+ ^ (void) { while (1) { } }();
^ (void) { if (j) while (1) { } }();
while (1) { }
}
_Noreturn void test5() {
test2_positive();
}
+
+// rdar://16274746
+void test6()
+{
+ (void)^{
+ for(;;)
+ ;
+ };
+}
+