Douglas Gregor | 225c41e | 2008-11-03 19:09:14 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
Douglas Gregor | 60d62c2 | 2008-10-31 16:23:19 +0000 | [diff] [blame] | 2 | class Z { }; |
| 3 | |
| 4 | class Y { |
| 5 | public: |
| 6 | Y(const Z&); |
| 7 | }; |
| 8 | |
| 9 | class X { |
| 10 | public: |
| 11 | X(int); |
| 12 | X(const Y&); |
| 13 | }; |
| 14 | |
| 15 | void f(X); |
| 16 | |
| 17 | void g(short s, Y y, Z z) { |
| 18 | f(s); |
| 19 | f(1.0f); |
| 20 | f(y); |
Douglas Gregor | 225c41e | 2008-11-03 19:09:14 +0000 | [diff] [blame] | 21 | f(z); // expected-error{{incompatible type passing 'class Z', expected 'class X'}} |
Douglas Gregor | 60d62c2 | 2008-10-31 16:23:19 +0000 | [diff] [blame] | 22 | } |
| 23 | |