blob: eecb445ea9239bdcd2d8bda5fd3903222ad0d504 [file] [log] [blame]
Daniel Dunbar8fbe78f2009-12-15 20:14:24 +00001// RUN: %clang_cc1 -fsyntax-only -Wall -verify %s
Anders Carlsson70553942009-08-29 05:16:22 +00002
3template<typename T> struct A {
Douglas Gregor7ae2d772010-01-31 09:12:51 +00004 A() : a(1) { } // expected-error{{cannot initialize a member subobject of type 'void *' with an rvalue of type 'int'}}
Anders Carlsson70553942009-08-29 05:16:22 +00005
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;
Eli Friedman15e05262009-08-29 22:22:07 +000021
22template <class T> struct AA { AA(int); };
23template <class T> class BB : public AA<T> {
24 BB() : AA<T>(1) {}
25};
26BB<int> x;