blob: eecb445ea9239bdcd2d8bda5fd3903222ad0d504 [file] [log] [blame]
Shih-wei Liaof8fd82b2010-02-10 11:10:31 -08001// RUN: %clang_cc1 -fsyntax-only -Wall -verify %s
2
3template<typename T> struct A {
4 A() : a(1) { } // expected-error{{cannot initialize a member subobject of type 'void *' with an rvalue of type 'int'}}
5
6 T a;
7};
8
9A<int> a0;
10A<void*> a1; // expected-note{{in instantiation of member function 'A<void *>::A' requested here}}
11
12template<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
20B<int> b0;
21
22template <class T> struct AA { AA(int); };
23template <class T> class BB : public AA<T> {
24 BB() : AA<T>(1) {}
25};
26BB<int> x;