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