summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/Parser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-07 00:48:47 +0000
committerChris Lattner <sabre@nondot.org>2009-12-07 00:48:47 +0000
commit045cbffb6573be84237047c53d8d52f304e204b4 (patch)
tree573b91d8cca339ac3f3589a1e8c76a29340077aa /clang/lib/Parse/Parser.cpp
parent662908cdcfcca1a2832b6580838fb592324474b8 (diff)
downloadbcm5719-llvm-045cbffb6573be84237047c53d8d52f304e204b4.tar.gz
bcm5719-llvm-045cbffb6573be84237047c53d8d52f304e204b4.zip
fix a crash on invalid I found when working on something unrelated.
llvm-svn: 90729
Diffstat (limited to 'clang/lib/Parse/Parser.cpp')
-rw-r--r--clang/lib/Parse/Parser.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Parse/Parser.cpp b/clang/lib/Parse/Parser.cpp
index ca425e8b052..20e5c589d71 100644
--- a/clang/lib/Parse/Parser.cpp
+++ b/clang/lib/Parse/Parser.cpp
@@ -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.
OpenPOWER on IntegriCloud