-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Parser][ObjC] Fix crash on nested top-level block with better recove…
…ry path Delay consuming tokens until we are certain that the next token is not top level block. Otherwise we bail out as if we saw an @EnD for better diagnostic and recovery. Fixes #64065. Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D156277.
- Loading branch information
Showing
6 changed files
with
52 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -verify %s | ||
|
||
@interface Roo // expected-note {{class started here}} | ||
// expected-error@+1 {{missing '@end'}} | ||
@interface // expected-error {{expected identifier}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -verify %s | ||
// rdar://8283484 | ||
// expected-note@+1 {{previous definition is here}} | ||
@interface blah { // expected-note {{class started here}} | ||
@private | ||
} | ||
// since I forgot the @end here it should say something | ||
|
||
// expected-error@+1 {{duplicate interface definition for class 'blah'}} | ||
@interface blah // expected-error {{missing '@end'}} | ||
@end // and Unknown type name 'end' here | ||
@end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters