Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Andy Gibbs | 8e8fb3b | 2012-10-19 12:44:48 +0000 | [diff] [blame] | 2 | // expected-no-diagnostics |
Eli Friedman | 59c0437 | 2009-07-29 19:44:27 +0000 | [diff] [blame] | 3 | |
Douglas Gregor | 42c39f3 | 2009-08-26 18:27:52 +0000 | [diff] [blame] | 4 | // PR4381 |
| 5 | template<class T> struct X {}; |
| 6 | template<typename T> struct Y : public X<T>::X { }; |
| 7 | |
Eli Friedman | 59c0437 | 2009-07-29 19:44:27 +0000 | [diff] [blame] | 8 | // PR4621 |
| 9 | class A1 { |
| 10 | A1(int x) {} |
| 11 | }; |
| 12 | template<class C> class B1 : public A1 { |
| 13 | B1(C x) : A1(x.x) {} |
| 14 | }; |
| 15 | class A2 { A2(int x, int y); }; |
| 16 | template <class C> class B2 { |
| 17 | A2 x; |
| 18 | B2(C x) : x(x.x, x.y) {} |
| 19 | }; |
| 20 | template <class C> class B3 { |
| 21 | C x; |
| 22 | B3() : x(1,2) {} |
| 23 | }; |
| 24 | |
| 25 | // PR4627 |
| 26 | template<typename _Container> class insert_iterator { |
| 27 | _Container* container; |
| 28 | insert_iterator(_Container& __x) : container(&__x) {} |
| 29 | }; |
| 30 | |
Fariborz Jahanian | 77a2b4f | 2009-08-24 17:19:23 +0000 | [diff] [blame] | 31 | // PR4763 |
| 32 | template<typename T> struct s0 {}; |
| 33 | template<typename T> struct s0_traits {}; |
| 34 | template<typename T> struct s1 : s0<typename s0_traits<T>::t0> { |
| 35 | s1() {} |
| 36 | }; |
| 37 | |
Douglas Gregor | 7a886e1 | 2010-01-19 06:46:48 +0000 | [diff] [blame] | 38 | // PR6062 |
| 39 | namespace PR6062 { |
| 40 | template <typename T> |
| 41 | class A : public T::type |
| 42 | { |
| 43 | A() : T::type() |
| 44 | { |
| 45 | } |
| 46 | |
| 47 | template <typename U> |
| 48 | A(U const& init) |
| 49 | : T::type(init) |
| 50 | { } |
| 51 | |
| 52 | template<typename U> |
| 53 | A(U& init) : U::other_type(init) { } |
| 54 | }; |
| 55 | } |
Douglas Gregor | e8aba3d | 2010-01-19 06:47:24 +0000 | [diff] [blame] | 56 | |
| 57 | template<typename T, typename U> |
| 58 | struct X0 : T::template apply<U> { |
| 59 | X0(int i) : T::template apply<U>(i) { } |
| 60 | }; |
Eli Friedman | 0f2b97d | 2010-07-24 21:19:15 +0000 | [diff] [blame] | 61 | |
| 62 | // PR7698 |
| 63 | namespace PR7698 { |
| 64 | template<typename Type> |
| 65 | class A { |
| 66 | char mA[sizeof(Type *)]; |
| 67 | A(): mA() {} |
| 68 | }; |
| 69 | } |