summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-12-23 23:51:58 +0000
committerDouglas Gregor <dgregor@apple.com>2010-12-23 23:51:58 +0000
commitda3cc0d3bf22d8dd92df063c38ff788c713b78df (patch)
treef023677331cafb43b4bd87629648ec3bee5f1f8e /clang/test
parentd71ffbcb2477dbd52aa5702c3ca994e720a1d360 (diff)
downloadbcm5719-llvm-da3cc0d3bf22d8dd92df063c38ff788c713b78df.tar.gz
bcm5719-llvm-da3cc0d3bf22d8dd92df063c38ff788c713b78df.zip
Add an AST representation for non-type template parameter
packs, e.g., template<typename T, unsigned ...Dims> struct multi_array; along with semantic analysis support for finding unexpanded non-type template parameter packs in types, expressions, and so on. Template instantiation involving non-type template parameter packs probably doesn't work yet. That'll come soon. llvm-svn: 122527
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p13.cpp4
-rw-r--r--clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp20
2 files changed, 22 insertions, 2 deletions
diff --git a/clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p13.cpp b/clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p13.cpp
index 59a0e7538d9..d6df2370ad9 100644
--- a/clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p13.cpp
+++ b/clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/p13.cpp
@@ -11,12 +11,12 @@ void f1(const Types &...args); // FIXME: temporary expected-error{{clang does no
// [ Note: Otherwise, the parameter-declaration is part of a
// template-parameter-list and the parameter pack is a template
// parameter pack; see 14.1. -- end note ]
-template<int ...N> // FIXME: temporary expected-error{{clang does not yet support non-type template parameter packs}}
+template<int ...N>
struct X0 { };
template<typename ...Types>
struct X1 {
- template<Types ...Values> struct Inner; // FIXME: temporary expected-error{{clang does not yet support non-type template parameter packs}}
+ template<Types ...Values> struct Inner;
};
// A declarator-id or abstract-declarator containing an ellipsis shall
diff --git a/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp b/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp
index aff9b44539f..47581fee90a 100644
--- a/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp
+++ b/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp
@@ -128,6 +128,26 @@ struct TestPPName
};
// FIXME: Test for unexpanded parameter packs in each of the expression nodes.
+template<int ...Values>
+void test_unexpanded_in_exprs() {
+ // PredefinedExpr is uninteresting
+ // DeclRefExpr
+ Values; // expected-error{{expression contains unexpanded parameter pack 'Values'}}
+ // IntegerLiteral is uninteresting
+ // FloatingLiteral is uninteresting
+ // ImaginaryLiteral is uninteresting
+ // StringLiteral is uninteresting
+ // CharacterLiteral is uninteresting
+ (Values); // expected-error{{expression contains unexpanded parameter pack 'Values'}}
+ // UnaryOperator
+ -Values; // expected-error{{expression contains unexpanded parameter pack 'Values'}}
+ // OffsetOfExpr
+ struct OffsetMe {
+ int array[17];
+ };
+ __builtin_offsetof(OffsetMe, array[Values]); // expected-error{{expression contains unexpanded parameter pack 'Values'}}
+ // FIXME: continue this...
+}
template<typename ... Types>
void TestPPNameFunc(int i) {
OpenPOWER on IntegriCloud