aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseExprCXX.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-26 04:27:47 +0000
committerChris Lattner <sabre@nondot.org>2009-06-26 04:27:47 +0000
commitc8e27cc402043ec86c1698c09e4ee9e415b16207 (patch)
tree678dcdb449fbdfde7f785102db47b89a988bc914 /lib/Parse/ParseExprCXX.cpp
parentb76c2322bf5b6d4ff151dcc3c5d2080e1834c4c5 (diff)
fix PR4452, a crash on invalid. The error recovery is still terrible in this case
but at least we don't crash :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseExprCXX.cpp')
-rw-r--r--lib/Parse/ParseExprCXX.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Parse/ParseExprCXX.cpp b/lib/Parse/ParseExprCXX.cpp
index 68964e91ee..d89f1e172f 100644
--- a/lib/Parse/ParseExprCXX.cpp
+++ b/lib/Parse/ParseExprCXX.cpp
@@ -85,8 +85,10 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS) {
= Actions.ActOnDependentTemplateName(TemplateKWLoc,
*Tok.getIdentifierInfo(),
Tok.getLocation(), SS);
- AnnotateTemplateIdToken(Template, TNK_Dependent_template_name,
- &SS, TemplateKWLoc, false);
+ if (AnnotateTemplateIdToken(Template, TNK_Dependent_template_name,
+ &SS, TemplateKWLoc, false))
+ break;
+
continue;
}
@@ -179,7 +181,9 @@ bool Parser::ParseOptionalCXXScopeSpecifier(CXXScopeSpec &SS) {
// because some clients (e.g., the parsing of class template
// specializations) still want to see the original template-id
// token.
- AnnotateTemplateIdToken(Template, TNK, &SS, SourceLocation(), false);
+ if (AnnotateTemplateIdToken(Template, TNK, &SS, SourceLocation(),
+ false))
+ break;
continue;
}
}