summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp26
-rw-r--r--clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp5
-rw-r--r--clang/test/CXX/temp/temp.decls/temp.variadic/parameter-matching.cpp2
-rw-r--r--clang/test/CXX/temp/temp.param/p9-0x.cpp4
4 files changed, 37 insertions, 0 deletions
diff --git a/clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp b/clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp
index 47b7793da03..3e9e8f5fb27 100644
--- a/clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp
+++ b/clang/test/CXX/temp/temp.decls/temp.variadic/metafunctions.cpp
@@ -138,3 +138,29 @@ namespace Indices {
int check0[is_same<build_indices<5>::type,
int_tuple<0, 1, 2, 3, 4>>::value? 1 : -1];
}
+
+namespace TemplateTemplateApply {
+ template<typename T, template<class> class ...Meta>
+ struct apply_each {
+ typedef tuple<typename Meta<T>::type...> type;
+ };
+
+ template<typename T>
+ struct add_reference {
+ typedef T& type;
+ };
+
+ template<typename T>
+ struct add_pointer {
+ typedef T* type;
+ };
+
+ template<typename T>
+ struct add_const {
+ typedef const T type;
+ };
+
+ int check0[is_same<apply_each<int,
+ add_reference, add_pointer, add_const>::type,
+ tuple<int&, int*, int const>>::value? 1 : -1];
+}
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 729a6a0bb28..f0822c34526 100644
--- a/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp
+++ b/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp
@@ -154,6 +154,11 @@ void TestPPNameFunc(int i) {
f(static_cast<Types>(i)); // expected-error{{expression contains unexpanded parameter pack 'Types'}}
}
+template<typename T, template<class> class ...Meta>
+struct TestUnexpandedTTP {
+ typedef tuple<typename Meta<T>::type> type; // expected-error{{declaration type contains unexpanded parameter pack 'Meta'}}
+};
+
// Test for unexpanded parameter packs in declarations.
// FIXME: Attributes?
template<typename T, typename... Types>
diff --git a/clang/test/CXX/temp/temp.decls/temp.variadic/parameter-matching.cpp b/clang/test/CXX/temp/temp.decls/temp.variadic/parameter-matching.cpp
index 7352be2d72f..126a0961b1c 100644
--- a/clang/test/CXX/temp/temp.decls/temp.variadic/parameter-matching.cpp
+++ b/clang/test/CXX/temp/temp.decls/temp.variadic/parameter-matching.cpp
@@ -19,3 +19,5 @@ template<template<typename T> class> struct X1tt; // expected-error{{template ty
template<template<typename T> class> struct X2tt; // expected-note{{previous template type parameter declared here}}
template<template<typename ...T> class> struct X2tt; // expected-error{{template type parameter pack conflicts with previous template type parameter}}
+
+// FIXME: Add checks for non-type template parameter packs, template parameter packs
diff --git a/clang/test/CXX/temp/temp.param/p9-0x.cpp b/clang/test/CXX/temp/temp.param/p9-0x.cpp
index 42d1adf2972..1980bc6eaa1 100644
--- a/clang/test/CXX/temp/temp.param/p9-0x.cpp
+++ b/clang/test/CXX/temp/temp.param/p9-0x.cpp
@@ -8,3 +8,7 @@ struct X0;
template<int ...Values = 0> // expected-error{{template parameter pack cannot have a default argument}}
struct X1;
+template<typename T> struct vector;
+
+template<template<class> class ...Templates = vector> // expected-error{{template parameter pack cannot have a default argument}}
+struct X2;
OpenPOWER on IntegriCloud