
Mark the whole StmtExpr invalid when the last statement in compound statement is invalid. Because the last statement need to do copy initialization, it causes subsequent errors to simply ignore last invalid statement. Fixed: #113468
13 lines
260 B
C++
13 lines
260 B
C++
// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
|
|
|
|
constexpr int expr() {
|
|
if (({
|
|
int f;
|
|
f = 0;
|
|
if (f)
|
|
break; // expected-error {{'break' statement not in loop or switch statement}}
|
|
}))
|
|
return 2;
|
|
return 1;
|
|
}
|