diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-05-21 23:43:39 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-05-21 23:43:39 +0000 |
commit | d5ab9b0a0ae24f7d0f49f6f10fd1b247e64b3306 (patch) | |
tree | 4185449285f55ec7c5128a5d28ef8950230d00c3 /lib/Parse/ParseTemplate.cpp | |
parent | 561da7e046ea6b39f4e632c68128fd01c985b46b (diff) |
Improve recovery when we see a dependent template name that is missing
the required "template" keyword, using the same heuristics we do for
dependent template names in member access expressions, e.g.,
test/SemaTemplate/dependent-template-recover.cpp:11:8: error: use 'template'
keyword to treat 'getAs' as a dependent template name
T::getAs<U>();
^
template
Fixes PR5404.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104409 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseTemplate.cpp')
-rw-r--r-- | lib/Parse/ParseTemplate.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp index 8b9142ce9b..c87ddad4e9 100644 --- a/lib/Parse/ParseTemplate.cpp +++ b/lib/Parse/ParseTemplate.cpp @@ -971,12 +971,17 @@ ParsedTemplateArgument Parser::ParseTemplateArgument() { /// \brief Determine whether the current tokens can only be parsed as a /// template argument list (starting with the '<') and never as a '<' /// expression. -bool Parser::IsTemplateArgumentList() { +bool Parser::IsTemplateArgumentList(unsigned Skip) { struct AlwaysRevertAction : TentativeParsingAction { AlwaysRevertAction(Parser &P) : TentativeParsingAction(P) { } ~AlwaysRevertAction() { Revert(); } } Tentative(*this); + while (Skip) { + ConsumeToken(); + --Skip; + } + // '<' if (!Tok.is(tok::less)) return false; |