diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-01-03 19:31:53 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-01-03 19:31:53 +0000 |
commit | dcaa1ca0b475dfa887e1d061678a1e3501288510 (patch) | |
tree | 45ea581adb8871c9710f17e18dca1ce2a064e043 /test | |
parent | ef9d09c4699a2a61d6f28b59b7583b2b28c0a531 (diff) |
Implement support for pack expansions in initializer lists and
expression lists.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122764 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/CXX/temp/temp.decls/temp.variadic/p4.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/CXX/temp/temp.decls/temp.variadic/p4.cpp b/test/CXX/temp/temp.decls/temp.variadic/p4.cpp index 06a7bf3679..440bd4b5db 100644 --- a/test/CXX/temp/temp.decls/temp.variadic/p4.cpp +++ b/test/CXX/temp/temp.decls/temp.variadic/p4.cpp @@ -20,6 +20,20 @@ struct is_same<T, T> { // FIXME: Many more bullets to go +// In an initializer-list (8.5); the pattern is an initializer-clause. +// Note: this also covers expression-lists, since expression-list is +// just defined as initializer-list. +void five_args(int, int, int, int, int); // expected-note{{candidate function not viable: requires 5 arguments, but 6 were provided}} + +template<int ...Values> +void initializer_list_expansion() { + int values[5] = { Values... }; // expected-error{{excess elements in array initializer}} + five_args(Values...); // expected-error{{no matching function for call to 'five_args'}} +} + +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 template-argument-list (14.3); the pattern is a template-argument. template<typename ...Types> struct tuple_of_refs { |