p5.cpp revision 9ef75899bae6dd9a4be1252ae9cadcb619c170ff
1// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s 2 3 4// An appearance of a name of a parameter pack that is not expanded is 5// ill-formed. 6template<typename ... Types> 7struct TestPPName 8 : public Types // expected-error{{base type contains unexpanded parameter pack 'Types'}} 9{ 10 typedef Types *types_pointer; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}} 11}; 12 13template<typename ... Types> 14void TestPPNameFunc(int i) { 15 f(static_cast<Types>(i)); // expected-error{{expression contains unexpanded parameter pack 'Types'}} 16} 17 18template<typename T, typename U> struct pair; 19 20template<typename ...OuterTypes> 21struct MemberTemplatePPNames { 22 template<typename ...InnerTypes> 23 struct Inner { 24 typedef pair<OuterTypes, InnerTypes>* types; // expected-error{{declaration type contains unexpanded parameter packs 'OuterTypes' and 'InnerTypes'}} 25 26 template<typename ...VeryInnerTypes> 27 struct VeryInner { 28 typedef pair<pair<VeryInnerTypes, OuterTypes>, pair<InnerTypes, OuterTypes> > types; // expected-error{{declaration type contains unexpanded parameter packs 'VeryInnerTypes', 'OuterTypes', ...}} 29 }; 30 }; 31}; 32