Skip to content

Commit 1eb0ad2

Browse files
authored
Merge pull request #78095 from slavapestov/assert-on-diagnostic-flags
AST: Make -Xllvm -swift-diagnostics-assert-on-error and -Xllvm -swift-diagnostics-assert-on-warning work in noassert builds
2 parents 81c6575 + ed5e22d commit 1eb0ad2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/AST/DiagnosticEngine.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,8 +1251,8 @@ DiagnosticBehavior DiagnosticState::determineBehavior(const Diagnostic &diag) {
12511251
anyErrorOccurred = true;
12521252
}
12531253

1254-
assert((!AssertOnError || !anyErrorOccurred) && "We emitted an error?!");
1255-
assert((!AssertOnWarning || (lvl != DiagnosticBehavior::Warning)) &&
1254+
ASSERT((!AssertOnError || !anyErrorOccurred) && "We emitted an error?!");
1255+
ASSERT((!AssertOnWarning || (lvl != DiagnosticBehavior::Warning)) &&
12561256
"We emitted a warning?!");
12571257

12581258
previousBehavior = lvl;

0 commit comments

Comments
 (0)