Skip to content

Commit 28e1c30

Browse files
committed
Allow declaration recovery to consume attributes.
Fixes #60702 / rdar://98967894
1 parent 20be955 commit 28e1c30

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

include/swift/Parse/Parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ class Parser {
695695
tok::pound_else, tok::pound_elseif,
696696
tok::code_complete) &&
697697
!isStartOfStmt() &&
698-
!isStartOfSwiftDecl(/*allowPoundIfAttributes=*/false)) {
698+
!isStartOfSwiftDecl(/*allowPoundIfAttributes=*/true)) {
699699
skipSingle();
700700
}
701701
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// RUN: not %target-swift-frontend -parse %s
2+
@
3+
#if true
4+
print("x")
5+
#endif

0 commit comments

Comments
 (0)