p5.cpp revision 7536dd5e6c99584481b7dab68b7e7d8df9c54054
1cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor// RUN: %clang_cc1 -std=c++0x -fblocks -fsyntax-only -verify %s
2d0937224f383c7cc72c947119380f9713a070c73Douglas Gregor
37536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregortemplate<typename T, typename U> struct pair;
47536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor
57536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor// A parameter pack whose name appears within the pattern of a pack
67536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor// expansion is expanded by that pack expansion. An appearance of the
77536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor// name of a parameter pack is only expanded by the innermost
87536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor// enclosing pack expansion. The pattern of a pack expansion shall
97536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor// name one or more parameter packs that are not expanded by a nested
107536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor// pack expansion.
117536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregortemplate<typename... Types>
127536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregorstruct Expansion {
137536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor  typedef pair<Types..., int> expand_with_pacs; // okay
147536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor  typedef pair<Types, int...> expand_no_packs;  // expected-error{{pack expansion does not contain any unexpanded parameter packs}}
157536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor  typedef pair<pair<Types..., int>..., int> expand_with_expanded_nested; // expected-error{{pack expansion does not contain any unexpanded parameter packs}}
167536dd5e6c99584481b7dab68b7e7d8df9c54054Douglas Gregor};
17d0937224f383c7cc72c947119380f9713a070c73Douglas Gregor
18d0937224f383c7cc72c947119380f9713a070c73Douglas Gregor// An appearance of a name of a parameter pack that is not expanded is
19d0937224f383c7cc72c947119380f9713a070c73Douglas Gregor// ill-formed.
20cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
21cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor// Test for unexpanded parameter packs in each of the type nodes.
22cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregortemplate<typename T, int N, typename ... Types>
23d0937224f383c7cc72c947119380f9713a070c73Douglas Gregorstruct TestPPName
24cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  : public Types, public T  // expected-error{{base type contains unexpanded parameter pack 'Types'}}
25d0937224f383c7cc72c947119380f9713a070c73Douglas Gregor{
26cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // BuiltinType is uninteresting
27cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // FIXME: ComplexType is uninteresting?
28cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // PointerType
299ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor  typedef Types *types_pointer; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
30cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
31cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // BlockPointerType
32cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types (^block_pointer_1)(int); // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
33cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef int (^block_pointer_2)(Types); // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
34cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
35cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // LValueReferenceType
36cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types &lvalue_ref; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
37cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
38cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // RValueReferenceType
39cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types &&rvalue_ref; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
40cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
41cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // MemberPointerType
42cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types TestPPName::* member_pointer_1; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
43cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef int Types::*member_pointer_2; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
44cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
45cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // ConstantArrayType
46cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types constant_array[17]; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
47cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
48cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // IncompleteArrayType
49cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types incomplete_array[]; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
50cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
51cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // VariableArrayType
52cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  void f(int i) {
53cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor    Types variable_array[i]; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
54cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  }
55cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
56cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // DependentSizedArrayType
57cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types dependent_sized_array[N]; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
58cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
59cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // DependentSizedExtVectorType
60cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types dependent_sized_ext_vector __attribute__((ext_vector_type(N))); // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
61cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
62cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // VectorType is uninteresting
63cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
64cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // ExtVectorType
65cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types ext_vector __attribute__((ext_vector_type(4))); // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
66cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
67cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // FunctionProtoType
68cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types (function_type_1)(int); // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
69cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef int (function_type_2)(Types); // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
70cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
71cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // FunctionNoProtoType is uninteresting
72cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // UnresolvedUsingType is uninteresting
73cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // ParenType is uninteresting
74cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // TypedefType is uninteresting
75cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
76cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // TypeOfExprType
77cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef __typeof__((static_cast<Types>(0))) typeof_expr; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
78cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
79cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // TypeOfType
80cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef __typeof__(Types) typeof_type;  // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
81cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
82cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // DecltypeType
83cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef decltype((static_cast<Types>(0))) typeof_expr; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
84cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
85cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // RecordType is uninteresting
86cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // EnumType is uninteresting
87cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // ElaboratedType is uninteresting
88cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
89cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // TemplateTypeParmType
90cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef Types template_type_parm; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
91cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
92cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // SubstTemplateTypeParmType is uninteresting
93cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
94cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // TemplateSpecializationType
95cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef pair<Types, int> template_specialization; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
96cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
97cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // InjectedClassName is uninteresting.
98cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
99cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // DependentNameType
100cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef typename Types::type dependent_name; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
101cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
102cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // DependentTemplateSpecializationType
103cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef typename Types::template apply<int> dependent_name_1; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
104cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  typedef typename T::template apply<Types> dependent_name_2; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
105cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor
106cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // ObjCObjectType is uninteresting
107cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // ObjCInterfaceType is uninteresting
108cff163e3cc78277496b30fa40070b46abdc290dbDouglas Gregor  // ObjCObjectPointerType is uninteresting
109d0937224f383c7cc72c947119380f9713a070c73Douglas Gregor};
110bebbe0d9b7568ce43a464286bee49429489ef483Douglas Gregor
111e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor// FIXME: Test for unexpanded parameter packs in each of the expression nodes.
112e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor
113bebbe0d9b7568ce43a464286bee49429489ef483Douglas Gregortemplate<typename ... Types>
114bebbe0d9b7568ce43a464286bee49429489ef483Douglas Gregorvoid TestPPNameFunc(int i) {
1159ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor  f(static_cast<Types>(i)); // expected-error{{expression contains unexpanded parameter pack 'Types'}}
116bebbe0d9b7568ce43a464286bee49429489ef483Douglas Gregor}
1179ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor
118a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor// Test for unexpanded parameter packs in declarations.
119a31040f16604849b3b1dc36015056c81bae68ad1Douglas Gregor// FIXME: Attributes?
12056c04588ef3cfa1bbc968fd68de2480a4e66971dDouglas Gregortemplate<typename T, typename... Types>
12156c04588ef3cfa1bbc968fd68de2480a4e66971dDouglas Gregorstruct TestUnexpandedDecls : T{
122e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor  void member_function(Types);  // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
123e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor  void member_function () throw(Types); // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
12456c04588ef3cfa1bbc968fd68de2480a4e66971dDouglas Gregor  operator Types() const; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
125e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor  Types data_member;  // expected-error{{data member type contains unexpanded parameter pack 'Types'}}
126e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor  static Types static_data_member; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
127e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor  unsigned bit_field : static_cast<Types>(0);  // expected-error{{bit-field size contains unexpanded parameter pack 'Types'}}
128399ad970a25efcbfa7111e17f48285a70fba2731Douglas Gregor  static_assert(static_cast<Types>(0), "Boom"); // expected-error{{static assertion contains unexpanded parameter pack 'Types'}}
1290c9e4799fd78d350a037498b2c797f2b2558791cDouglas Gregor
1300c9e4799fd78d350a037498b2c797f2b2558791cDouglas Gregor  enum E0 : Types {  // expected-error{{fixed underlying type contains unexpanded parameter pack 'Types'}}
1310c9e4799fd78d350a037498b2c797f2b2558791cDouglas Gregor    EnumValue = static_cast<Types>(0) // expected-error{{enumerator value contains unexpanded parameter pack 'Types'}}
1320c9e4799fd78d350a037498b2c797f2b2558791cDouglas Gregor  };
13356c04588ef3cfa1bbc968fd68de2480a4e66971dDouglas Gregor
13456c04588ef3cfa1bbc968fd68de2480a4e66971dDouglas Gregor  using typename Types::type; // expected-error{{using declaration contains unexpanded parameter pack 'Types'}}
13556c04588ef3cfa1bbc968fd68de2480a4e66971dDouglas Gregor  using Types::value; // expected-error{{using declaration contains unexpanded parameter pack 'Types'}}
13656c04588ef3cfa1bbc968fd68de2480a4e66971dDouglas Gregor  using T::operator Types; // expected-error{{using declaration contains unexpanded parameter pack 'Types'}}
1376ccab97c17c17f38eb92c7fe02c766508875bd97Douglas Gregor
1386ccab97c17c17f38eb92c7fe02c766508875bd97Douglas Gregor  friend class Types::foo; // expected-error{{friend declaration contains unexpanded parameter pack 'Types'}}
1396ccab97c17c17f38eb92c7fe02c766508875bd97Douglas Gregor  friend void friend_func(Types); // expected-error{{friend declaration contains unexpanded parameter pack 'Types'}}
1406ccab97c17c17f38eb92c7fe02c766508875bd97Douglas Gregor  friend void Types::other_friend_func(int); // expected-error{{friend declaration contains unexpanded parameter pack 'Types'}}
141a31040f16604849b3b1dc36015056c81bae68ad1Douglas Gregor
142a31040f16604849b3b1dc36015056c81bae68ad1Douglas Gregor  void test_initializers() {
143a31040f16604849b3b1dc36015056c81bae68ad1Douglas Gregor    T copy_init = static_cast<Types>(0); // expected-error{{initializer contains unexpanded parameter pack 'Types'}}
144a31040f16604849b3b1dc36015056c81bae68ad1Douglas Gregor    T direct_init(0, static_cast<Types>(0)); // expected-error{{expression contains unexpanded parameter pack 'Types'}}
145a31040f16604849b3b1dc36015056c81bae68ad1Douglas Gregor    T list_init = { static_cast<Types>(0) }; // expected-error{{initializer contains unexpanded parameter pack 'Types'}}
146a31040f16604849b3b1dc36015056c81bae68ad1Douglas Gregor  }
1476f52675ec400a0ee89ec6214c4845b8ee274304aDouglas Gregor
1486f52675ec400a0ee89ec6214c4845b8ee274304aDouglas Gregor  void default_function_args(T = static_cast<Types>(0)); // expected-error{{default argument contains unexpanded parameter pack 'Types'}}
1496f52675ec400a0ee89ec6214c4845b8ee274304aDouglas Gregor
1506f52675ec400a0ee89ec6214c4845b8ee274304aDouglas Gregor  template<typename = Types*> // expected-error{{default argument contains unexpanded parameter pack 'Types'}}
1516f52675ec400a0ee89ec6214c4845b8ee274304aDouglas Gregor    struct default_template_args_1;
1526f52675ec400a0ee89ec6214c4845b8ee274304aDouglas Gregor  template<int = static_cast<Types>(0)> // expected-error{{default argument contains unexpanded parameter pack 'Types'}}
1536f52675ec400a0ee89ec6214c4845b8ee274304aDouglas Gregor    struct default_template_args_2;
1546f52675ec400a0ee89ec6214c4845b8ee274304aDouglas Gregor  template<template<typename> class = Types::template apply> // expected-error{{default argument contains unexpanded parameter pack 'Types'}}
1556f52675ec400a0ee89ec6214c4845b8ee274304aDouglas Gregor    struct default_template_args_3;
156781def075d4a486a5b367c6730fe77cb1f721ac1Douglas Gregor
157781def075d4a486a5b367c6730fe77cb1f721ac1Douglas Gregor  template<Types value> // expected-error{{non-type template parameter type contains unexpanded parameter pack 'Types'}}
158781def075d4a486a5b367c6730fe77cb1f721ac1Douglas Gregor  struct non_type_template_param_type;
159a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor
160a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor  void decls_in_stmts() {
161a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor    Types t; // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
162a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor    for (Types *t = 0; ; ) { } // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
163a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor    for (; Types *t = 0; ) { } // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
164a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor    switch(Types *t = 0) { } // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
165a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor    while(Types *t = 0) { } // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
166a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor    if (Types *t = 0) { } // expected-error{{declaration type contains unexpanded parameter pack 'Types'}}
167a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor    try {
168a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor    } catch (Types*) { // expected-error{{exception type contains unexpanded parameter pack 'Types'}}
169a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor    }
170a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor  }
171e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor};
172e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor
173a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor// FIXME: Test for unexpanded parameter packs in each of the statements.
174a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor
175a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor// FIXME: Once we have template argument deduction, we can test
176a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor// unexpanded parameter packs in partial specializations.
177a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor// template<typename ...Types>
178a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor// struct TestUnexpandedDecls<int, Types>;
179a669c534cf414339060868d70d2348fea9ce6c7dDouglas Gregor
180e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor// Test for diagnostics in the presence of multiple unexpanded
181e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor// parameter packs.
1829ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregortemplate<typename T, typename U> struct pair;
1839ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor
1849ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregortemplate<typename ...OuterTypes>
1859ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregorstruct MemberTemplatePPNames {
1869ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor  template<typename ...InnerTypes>
1879ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor  struct Inner {
1889ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor    typedef pair<OuterTypes, InnerTypes>* types; // expected-error{{declaration type contains unexpanded parameter packs 'OuterTypes' and 'InnerTypes'}}
1899ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor
1909ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor    template<typename ...VeryInnerTypes>
1919ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor    struct VeryInner {
1929ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor      typedef pair<pair<VeryInnerTypes, OuterTypes>, pair<InnerTypes, OuterTypes> > types; // expected-error{{declaration type contains unexpanded parameter packs 'VeryInnerTypes', 'OuterTypes', ...}}
1939ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor    };
1949ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor  };
1959ef75899bae6dd9a4be1252ae9cadcb619c170ffDouglas Gregor};
196e186269a8a41dbff1ebea2c251048892979d1078Douglas Gregor
197