diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-12-16 01:31:22 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-12-16 01:31:22 +0000 |
| commit | 71f39c96fb9ce245451831916247a0c91d067a78 (patch) | |
| tree | de16d1aa8e3cf87f0093735c2daeefcb0720a87c /clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp | |
| parent | 6e47260a8bf35e94d9380884b89741bde7b310be (diff) | |
| download | bcm5719-llvm-71f39c96fb9ce245451831916247a0c91d067a78.tar.gz bcm5719-llvm-71f39c96fb9ce245451831916247a0c91d067a78.zip | |
Check for unexpanded parameter packs within variable initializers.
llvm-svn: 121938
Diffstat (limited to 'clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp')
| -rw-r--r-- | clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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 7e5aff6fb0b..94bcfe6ed20 100644 --- a/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp +++ b/clang/test/CXX/temp/temp.decls/temp.variadic/p5.cpp @@ -104,6 +104,7 @@ void TestPPNameFunc(int i) { } // FIXME: Test for unexpanded parameter packs in declarations. +// FIXME: Attributes? template<typename T, typename... Types> struct TestUnexpandedDecls : T{ void member_function(Types); // expected-error{{declaration type contains unexpanded parameter pack 'Types'}} @@ -125,6 +126,12 @@ struct TestUnexpandedDecls : T{ friend class Types::foo; // expected-error{{friend declaration contains unexpanded parameter pack 'Types'}} friend void friend_func(Types); // expected-error{{friend declaration contains unexpanded parameter pack 'Types'}} friend void Types::other_friend_func(int); // expected-error{{friend declaration contains unexpanded parameter pack 'Types'}} + + void test_initializers() { + T copy_init = static_cast<Types>(0); // expected-error{{initializer contains unexpanded parameter pack 'Types'}} + T direct_init(0, static_cast<Types>(0)); // expected-error{{expression contains unexpanded parameter pack 'Types'}} + T list_init = { static_cast<Types>(0) }; // expected-error{{initializer contains unexpanded parameter pack 'Types'}} + } }; // Test for diagnostics in the presence of multiple unexpanded |

