blob: 5ef84de9acda8a231bd6d6ab3158608edc64430d [file] [log] [blame]
Douglas Gregor6428e762008-11-05 15:29:30 +00001// RUN: clang -fsyntax-only -verify %s
2
3class X {
4public:
5 explicit X(const X&);
6 X(int*); // expected-note{{candidate function}}
7 explicit X(float*);
8};
9
10class Y : public X { };
11
12void f(Y y, int *ip, float *fp) {
Sebastian Redlfd9f2ac2008-11-22 13:44:36 +000013 X x1 = y; // expected-error{{no matching constructor for initialization of 'x1'; candidate is:}}
Douglas Gregor6428e762008-11-05 15:29:30 +000014 X x2 = 0;
15 X x3 = ip;
16 X x4 = fp; // expected-error{{incompatible type initializing 'x4', expected 'class X'}}
17}