Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ Bug Fixes to AST Handling
legal representation. This is fixed because ElaboratedTypes don't exist anymore. (#GH43179) (#GH68670) (#GH92757)
- Fix unrecognized html tag causing undesirable comment lexing (#GH152944)
- Fix comment lexing of special command names (#GH152943)
- Use `extern` as a hint to continue parsing when recovering from a malformed declaration.

Miscellaneous Bug Fixes
^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 3 additions & 0 deletions clang/lib/Parse/ParseDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2083,6 +2083,9 @@ void Parser::SkipMalformedDecl() {
return;
break;

case tok::kw_extern:
// 'extern' at the start of a line is almost certainly a good
// place to pick back up parsing
case tok::kw_namespace:
// 'namespace' at the start of a line is almost certainly a good
// place to pick back up parsing, except in an Objective-C
Expand Down
9 changes: 9 additions & 0 deletions clang/test/Parser/recovery-after-expected-unqualified-id.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// RUN: %clang_cc1 -verify %s

3.2 // expected-error {{expected unqualified-id}}

extern "C" {
typedef int Int;
}

Int foo(); // Ok