diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-11-04 18:18:19 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-11-04 18:18:19 +0000 |
commit | 35522590591f96d5cf1a26fc92fa11109a94d119 (patch) | |
tree | 8605c1a5b2d84e36768a646f1e124398e1e5a64d /clang/lib/Parse/ParseTemplate.cpp | |
parent | 09cc10f9f8a8cf582bb80a2b509a30651c9b1e52 (diff) | |
download | bcm5719-llvm-35522590591f96d5cf1a26fc92fa11109a94d119.tar.gz bcm5719-llvm-35522590591f96d5cf1a26fc92fa11109a94d119.zip |
Properly replace (cxxscope, template-id) annotation tokens with a
single typename annotation token when backtracing. Fixes PR5350.
llvm-svn: 86034
Diffstat (limited to 'clang/lib/Parse/ParseTemplate.cpp')
-rw-r--r-- | clang/lib/Parse/ParseTemplate.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp index 045acd86ad0..99578837c21 100644 --- a/clang/lib/Parse/ParseTemplate.cpp +++ b/clang/lib/Parse/ParseTemplate.cpp @@ -809,12 +809,11 @@ void Parser::AnnotateTemplateIdTokenAsType(const CXXScopeSpec *SS) { Tok.setAnnotationValue(Type.isInvalid()? 0 : Type.get()); if (SS && SS->isNotEmpty()) // it was a C++ qualified type name. Tok.setLocation(SS->getBeginLoc()); + Tok.setAnnotationEndLoc(TemplateId->TemplateNameLoc); - // We might be backtracking, in which case we need to replace the - // template-id annotation token with the type annotation within the - // set of cached tokens. That way, we won't try to form the same - // class template specialization again. - PP.ReplaceLastTokenWithAnnotation(Tok); + // Replace the template-id annotation token, and possible the scope-specifier + // that precedes it, with the typename annotation token. + PP.AnnotateCachedTokens(Tok); TemplateId->Destroy(); } |