blob: 1d4fed3e1d267043005e54450ace9e4ed10f1f52 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Eli Friedman59c04372009-07-29 19:44:27 +00002
Douglas Gregor42c39f32009-08-26 18:27:52 +00003// PR4381
4template<class T> struct X {};
5template<typename T> struct Y : public X<T>::X { };
6
Eli Friedman59c04372009-07-29 19:44:27 +00007// PR4621
8class A1 {
9 A1(int x) {}
10};
11template<class C> class B1 : public A1 {
12 B1(C x) : A1(x.x) {}
13};
14class A2 { A2(int x, int y); };
15template <class C> class B2 {
16 A2 x;
17 B2(C x) : x(x.x, x.y) {}
18};
19template <class C> class B3 {
20 C x;
21 B3() : x(1,2) {}
22};
23
24// PR4627
25template<typename _Container> class insert_iterator {
26 _Container* container;
27 insert_iterator(_Container& __x) : container(&__x) {}
28};
29
Fariborz Jahanian77a2b4f2009-08-24 17:19:23 +000030// PR4763
31template<typename T> struct s0 {};
32template<typename T> struct s0_traits {};
33template<typename T> struct s1 : s0<typename s0_traits<T>::t0> {
34 s1() {}
35};
36
Douglas Gregor7a886e12010-01-19 06:46:48 +000037// PR6062
38namespace PR6062 {
39 template <typename T>
40 class A : public T::type
41 {
42 A() : T::type()
43 {
44 }
45
46 template <typename U>
47 A(U const& init)
48 : T::type(init)
49 { }
50
51 template<typename U>
52 A(U& init) : U::other_type(init) { }
53 };
54}
Douglas Gregore8aba3d2010-01-19 06:47:24 +000055
56template<typename T, typename U>
57struct X0 : T::template apply<U> {
58 X0(int i) : T::template apply<U>(i) { }
59};
Eli Friedman0f2b97d2010-07-24 21:19:15 +000060
61// PR7698
62namespace PR7698 {
63 template<typename Type>
64 class A {
65 char mA[sizeof(Type *)];
66 A(): mA() {}
67 };
68}