Skip to content

Commit 33d1fc9

Browse files
authored
Merge pull request #17508 from graydon/rdar-41154797-multiline-pound-diagnostic
[Parse] <rdar://41154797> Detect eof in non-string-arg recovery loop in #error arg list.
2 parents a623002 + c2d67d8 commit 33d1fc9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/Parse/ParseDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3285,7 +3285,7 @@ ParserResult<PoundDiagnosticDecl> Parser::parseDeclPoundDiagnostic() {
32853285
// Catch #warning(oops, forgot the quotes)
32863286
SourceLoc wordsStartLoc = Tok.getLoc();
32873287

3288-
while (!Tok.isAtStartOfLine() && Tok.isNot(tok::r_paren)) {
3288+
while (!Tok.isAtStartOfLine() && !Tok.isAny(tok::r_paren, tok::eof)) {
32893289
skipSingle();
32903290
}
32913291

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// RUN: not %target-typecheck-verify-swift
2+
3+
#error("""
4+

0 commit comments

Comments
 (0)