Anders Carlsson | 0902531 | 2009-08-29 05:16:22 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -Wall -verify %s |
| 2 | |
| 3 | template<typename T> struct A { |
| 4 | A() : a(1) { } // expected-error{{incompatible type passing 'int', expected 'void *'}} |
| 5 | |
| 6 | T a; |
| 7 | }; |
| 8 | |
| 9 | A<int> a0; |
| 10 | A<void*> a1; // expected-note{{in instantiation of member function 'A<void *>::A' requested here}} |
| 11 | |
| 12 | template<typename T> struct B { |
| 13 | // FIXME: This should warn about initialization order |
| 14 | B() : b(1), a(2) { } |
| 15 | |
| 16 | int a; |
| 17 | int b; |
| 18 | }; |
| 19 | |
| 20 | B<int> b0; |
Eli Friedman | c5573a8 | 2009-08-29 22:22:07 +0000 | [diff] [blame] | 21 | |
| 22 | template <class T> struct AA { AA(int); }; |
| 23 | template <class T> class BB : public AA<T> { |
| 24 | BB() : AA<T>(1) {} |
| 25 | }; |
| 26 | BB<int> x; |