summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse/ParseTemplate.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-06-12 23:09:56 +0000
committerAnders Carlsson <andersca@mac.com>2009-06-12 23:09:56 +0000
commitf986ba752867abe6c74f5e015178a84cd03d3c92 (patch)
tree1ac6caad19c7bc562eb2295f4b03e59d3cb675b5 /clang/lib/Parse/ParseTemplate.cpp
parent815b70efcddcd7edbb3888104c85cfdd44dd72f0 (diff)
downloadbcm5719-llvm-f986ba752867abe6c74f5e015178a84cd03d3c92.tar.gz
bcm5719-llvm-f986ba752867abe6c74f5e015178a84cd03d3c92.zip
Address more comments from Doug.
llvm-svn: 73267
Diffstat (limited to 'clang/lib/Parse/ParseTemplate.cpp')
-rw-r--r--clang/lib/Parse/ParseTemplate.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/clang/lib/Parse/ParseTemplate.cpp b/clang/lib/Parse/ParseTemplate.cpp
index 30924b217f2..a9f75d8be17 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' ...[opt] identifier[opt]
+/// 'class' ...[opt][C++0x] identifier[opt]
/// 'class' identifier[opt] '=' type-id
-/// 'typename' ...[opt] identifier[opt]
+/// 'typename' ...[opt][C++0x] identifier[opt]
/// 'typename' identifier[opt] '=' type-id
-/// 'template' ...[opt] '<' template-parameter-list '>' 'class' identifier[opt]
+/// 'template' ...[opt][C++0x] '<' 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' ...[opt] identifier[opt]
+/// 'class' ...[opt][C++0x] identifier[opt]
/// 'class' identifier[opt] '=' type-id
-/// 'typename' ...[opt] identifier[opt]
+/// 'typename' ...[opt][C++0x] 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)) &&
@@ -334,9 +334,12 @@ Parser::DeclPtrTy Parser::ParseTypeParameter(unsigned Depth, unsigned Position){
// Grab the ellipsis (if given).
bool Ellipsis = false;
SourceLocation EllipsisLoc;
- if (getLang().CPlusPlus0x && Tok.is(tok::ellipsis)) {
+ if (Tok.is(tok::ellipsis)) {
Ellipsis = true;
EllipsisLoc = ConsumeToken();
+
+ if (!getLang().CPlusPlus0x)
+ Diag(EllipsisLoc, diag::err_variadic_templates);
}
// Grab the template parameter name (if given)
OpenPOWER on IntegriCloud