diff options
author | Richard Smith <richard@metafoo.co.uk> | 2020-01-17 15:42:11 -0800 |
---|---|---|
committer | Saar Raz <saar@raz.email> | 2020-01-24 02:28:20 +0200 |
commit | ab514b91196345ba4c61026e4997871e85ddd97d (patch) | |
tree | 953c9e6226fd9cd37dda565b3b11bd6791b81184 /clang/lib/Parse/ParseTentative.cpp | |
parent | 57f70e387e362d988937b6627461d781ecf09e50 (diff) | |
download | bcm5719-llvm-ab514b91196345ba4c61026e4997871e85ddd97d.tar.gz bcm5719-llvm-ab514b91196345ba4c61026e4997871e85ddd97d.zip |
Remove redundant CXXScopeSpec from TemplateIdAnnotation.
A TemplateIdAnnotation represents only a template-id, not a
nested-name-specifier plus a template-id. Don't make a redundant copy of
the CXXScopeSpec and store it on the template-id annotation.
This slightly improves error recovery by more properly handling the case
where we would form an invalid CXXScopeSpec while parsing a typename
specifier, instead of accidentally putting the token stream into a
broken "annot_template_id with a scope specifier, but with no preceding
annot_cxxscope token" state.
(cherry picked from commit a42fd84cff265b7e9faa3fe42885ee171393e4db)
Diffstat (limited to 'clang/lib/Parse/ParseTentative.cpp')
-rw-r--r-- | clang/lib/Parse/ParseTentative.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Parse/ParseTentative.cpp b/clang/lib/Parse/ParseTentative.cpp index d5068fb11b8..79e96816f86 100644 --- a/clang/lib/Parse/ParseTentative.cpp +++ b/clang/lib/Parse/ParseTentative.cpp @@ -1519,7 +1519,7 @@ Parser::isCXXDeclarationSpecifier(Parser::TPResult BracedCastResult, if (TemplateId->Kind != TNK_Type_template) return TPResult::False; CXXScopeSpec SS; - AnnotateTemplateIdTokenAsType(); + AnnotateTemplateIdTokenAsType(SS); assert(Tok.is(tok::annot_typename)); goto case_typename; } |