summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Parse/ParseTemplate.cpp')
-rw-r--r--clang/lib/Parse/ParseTemplate.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp
index 2a79b99d29c..30924b217f2 100644
--- a/clang/lib/Parse/ParseTemplate.cpp
+++ b/clang/lib/Parse/ParseTemplate.cpp
@@ -290,11 +290,11 @@ Parser::ParseTemplateParameterList(unsigned Depth,
/// parameter-declaration
///
/// type-parameter: (see below)
-/// 'class' identifier[opt]
+/// 'class' ...[opt] identifier[opt]
/// 'class' identifier[opt] '=' type-id
-/// 'typename' identifier[opt]
+/// 'typename' ...[opt] identifier[opt]
/// 'typename' identifier[opt] '=' type-id
-/// 'template' '<' template-parameter-list '>' 'class' identifier[opt]
+/// 'template' ...[opt] '<' template-parameter-list '>' 'class' identifier[opt]
/// 'template' '<' template-parameter-list '>' 'class' identifier[opt] = id-expression
Parser::DeclPtrTy
Parser::ParseTemplateParameter(unsigned Depth, unsigned Position) {
@@ -319,9 +319,9 @@ Parser::ParseTemplateParameter(unsigned Depth, unsigned Position) {
/// ParseTemplateTemplateParameter and ParseNonTypeTemplateParameter.
///
/// type-parameter: [C++ temp.param]
-/// 'class' identifier[opt]
+/// 'class' ...[opt] identifier[opt]
/// 'class' identifier[opt] '=' type-id
-/// 'typename' identifier[opt]
+/// 'typename' ...[opt] identifier[opt]
/// 'typename' identifier[opt] '=' type-id
Parser::DeclPtrTy Parser::ParseTypeParameter(unsigned Depth, unsigned Position){
assert((Tok.is(tok::kw_class) || Tok.is(tok::kw_typename)) &&
@@ -331,6 +331,14 @@ Parser::DeclPtrTy Parser::ParseTypeParameter(unsigned Depth, unsigned Position){
bool TypenameKeyword = Tok.is(tok::kw_typename);
SourceLocation KeyLoc = ConsumeToken();
+ // Grab the ellipsis (if given).
+ bool Ellipsis = false;
+ SourceLocation EllipsisLoc;
+ if (getLang().CPlusPlus0x && Tok.is(tok::ellipsis)) {
+ Ellipsis = true;
+ EllipsisLoc = ConsumeToken();
+ }
+
// Grab the template parameter name (if given)
SourceLocation NameLoc;
IdentifierInfo* ParamName = 0;
@@ -347,6 +355,7 @@ Parser::DeclPtrTy Parser::ParseTypeParameter(unsigned Depth, unsigned Position){
}
DeclPtrTy TypeParam = Actions.ActOnTypeParameter(CurScope, TypenameKeyword,
+ Ellipsis, EllipsisLoc,
KeyLoc, ParamName, NameLoc,
Depth, Position);
OpenPOWER on IntegriCloud