aboutsummaryrefslogtreecommitdiff
path: root/lib/Parse/ParseTemplate.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-04 23:51:17 +0000
committerChris Lattner <sabre@nondot.org>2009-01-04 23:51:17 +0000
commit532e19b4e18585d959065e407c51e625baf26d81 (patch)
treee5bdaaec41249e07dc5b9a6c9729217a594301f1 /lib/Parse/ParseTemplate.cpp
parente26ff02654971074a377ac6b922bdf3bb0f88c69 (diff)
Simplify some control flow and remove a call to TryAnnotateCXXScopeToken
that isn't doing what is desired. It was annotating the current token not the 'next' token. This code should be fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61656 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Parse/ParseTemplate.cpp')
-rw-r--r--lib/Parse/ParseTemplate.cpp23
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/Parse/ParseTemplate.cpp b/lib/Parse/ParseTemplate.cpp
index bd937d447a..076aae38cc 100644
--- a/lib/Parse/ParseTemplate.cpp
+++ b/lib/Parse/ParseTemplate.cpp
@@ -175,21 +175,20 @@ Parser::ParseTemplateParameterList(unsigned Depth,
/// 'template' '<' template-parameter-list '>' 'class' identifier[opt] = id-expression
Parser::DeclTy *
Parser::ParseTemplateParameter(unsigned Depth, unsigned Position) {
- TryAnnotateCXXScopeToken();
-
- if(Tok.is(tok::kw_class)
- || (Tok.is(tok::kw_typename) &&
+ if(Tok.is(tok::kw_class) ||
+ (Tok.is(tok::kw_typename) &&
+ // FIXME: Next token has not been annotated!
NextToken().isNot(tok::annot_qualtypename))) {
return ParseTypeParameter(Depth, Position);
- } else if(Tok.is(tok::kw_template)) {
- return ParseTemplateTemplateParameter(Depth, Position);
- } else {
- // If it's none of the above, then it must be a parameter declaration.
- // NOTE: This will pick up errors in the closure of the template parameter
- // list (e.g., template < ; Check here to implement >> style closures.
- return ParseNonTypeTemplateParameter(Depth, Position);
}
- return 0;
+
+ if(Tok.is(tok::kw_template))
+ return ParseTemplateTemplateParameter(Depth, Position);
+
+ // If it's none of the above, then it must be a parameter declaration.
+ // NOTE: This will pick up errors in the closure of the template parameter
+ // list (e.g., template < ; Check here to implement >> style closures.
+ return ParseNonTypeTemplateParameter(Depth, Position);
}
/// ParseTypeParameter - Parse a template type parameter (C++ [temp.param]).