diff options
| author | Douglas Gregor <dgregor@apple.com> | 2011-01-03 22:36:02 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2011-01-03 22:36:02 +0000 |
| commit | 752a595655d3dfcdbffb44b4d6a94275c550e7fe (patch) | |
| tree | 8e1d4f1312ffa2fa438266a66a7b747cc6631ac8 /clang/test/CXX/temp/temp.decls/temp.variadic/p4.cpp | |
| parent | d5756a609dbb14dff99cd83a0a50042da5275233 (diff) | |
| download | bcm5719-llvm-752a595655d3dfcdbffb44b4d6a94275c550e7fe.tar.gz bcm5719-llvm-752a595655d3dfcdbffb44b4d6a94275c550e7fe.zip | |
Implement pack expansions whose pattern is a base-specifier.
llvm-svn: 122782
Diffstat (limited to 'clang/test/CXX/temp/temp.decls/temp.variadic/p4.cpp')
| -rw-r--r-- | clang/test/CXX/temp/temp.decls/temp.variadic/p4.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/test/CXX/temp/temp.decls/temp.variadic/p4.cpp b/clang/test/CXX/temp/temp.decls/temp.variadic/p4.cpp index 440bd4b5dbf..49f6993b399 100644 --- a/clang/test/CXX/temp/temp.decls/temp.variadic/p4.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.variadic/p4.cpp @@ -34,6 +34,24 @@ void initializer_list_expansion() { template void initializer_list_expansion<1, 2, 3, 4, 5>(); template void initializer_list_expansion<1, 2, 3, 4, 5, 6>(); // expected-note{{in instantiation of function template specialization 'initializer_list_expansion<1, 2, 3, 4, 5, 6>' requested here}} +// In a base-specifier-list (Clause 10); the pattern is a base-specifier. +template<typename ...Mixins> +struct HasMixins : public Mixins... { }; + +struct A { }; +struct B { }; +struct C { }; +struct D { }; + +A *checkA = new HasMixins<A, B, C, D>; +B *checkB = new HasMixins<A, B, C, D>; +D *checkD = new HasMixins<A, B, C, D>; +C *checkC = new HasMixins<A, B, D>; // expected-error{{cannot initialize a variable of type 'C *' with an rvalue of type 'HasMixins<A, B, D> *'}} +HasMixins<> *checkNone = new HasMixins<>; + +template<typename Mixins> +struct BrokenMixins : public Mixins... { }; // expected-error{{pack expansion does not contain any unexpanded parameter packs}} + // In a template-argument-list (14.3); the pattern is a template-argument. template<typename ...Types> struct tuple_of_refs { |

