-
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.
[Clang] Fix crash in Parser::ParseDirectDeclarator by adding check th…
…at token is not an annotation token In Parser::ParseDirectDeclarator(...) in some cases ill-formed code can cause an annotation token to end up where it was not expected. The fix is to add a !Tok.isAnnotation() guard before attempting to access identifier info. This fixes: #64836 Differential Revision: https://reviews.llvm.org/D158804
- Loading branch information
Showing
3 changed files
with
15 additions
and
1 deletion.
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,12 @@ | ||
// RUN: %clang_cc1 -fsyntax-only -verify -xobjective-c++-header %s | ||
|
||
template <typename, typename> | ||
class C {}; | ||
|
||
class B { | ||
p // expected-error {{unknown type name 'p'}} | ||
private: // expected-error {{'private' is a keyword in Objective-C++}} | ||
void f() {} // expected-error {{expected '(' for function-style cast or type construction}} | ||
C<int, decltype(f)> c; // expected-error {{use of undeclared identifier 'f'}} | ||
// expected-error@-1 {{expected member name}} | ||
}; |