fix a crash on invalid I found when working on something unrelated.

llvm-svn: 90729
This commit is contained in:
Chris Lattner 2009-12-07 00:48:47 +00:00
parent 662908cdcf
commit 045cbffb65
2 changed files with 11 additions and 1 deletions

View File

@ -1030,7 +1030,9 @@ bool Parser::TryAnnotateCXXScopeToken(bool EnteringContext) {
CXXScopeSpec SS;
if (!ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/0, EnteringContext))
return Tok.is(tok::annot_template_id);
// If the token left behind is not an identifier, we either had an error or
// successfully turned it into an annotation token.
return Tok.isNot(tok::identifier);
// Push the current token back into the token stream (or revert it if it is
// cached) and use an annotation scope token for current token.

View File

@ -30,3 +30,11 @@ class B {
void f(A *a) { a->f(); }
};
template <typename t1, typename t2> class some_template;
friend // expected-error {{'friend' used outside of class}}
some_template<foo, bar>& // expected-error {{use of undeclared identifier 'foo'}}
; // expected-error {{expected unqualified-id}}