Douglas Gregor | 898574e | 2008-12-05 23:32:09 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
Douglas Gregor | 9103bb2 | 2008-12-17 22:52:20 +0000 | [diff] [blame] | 2 | class X { |
| 3 | public: |
| 4 | virtual int f(); |
| 5 | }; |
Douglas Gregor | 898574e | 2008-12-05 23:32:09 +0000 | [diff] [blame] | 6 | |
Douglas Gregor | fa04764 | 2009-02-04 00:32:51 +0000 | [diff] [blame] | 7 | void g(int); // expected-note{{candidate function}} |
Douglas Gregor | 898574e | 2008-12-05 23:32:09 +0000 | [diff] [blame] | 8 | |
| 9 | template<typename T> |
| 10 | T f(T x) { |
| 11 | (void)(x + 0); |
| 12 | (void)T(0); |
| 13 | (void)(x += 0); |
| 14 | (void)(x? x : x); |
Douglas Gregor | 9103bb2 | 2008-12-17 22:52:20 +0000 | [diff] [blame] | 15 | (void)static_cast<int>(x); |
| 16 | (void)reinterpret_cast<int>(x); |
| 17 | (void)dynamic_cast<X*>(&x); |
| 18 | (void)const_cast<int>(x); |
Douglas Gregor | 898574e | 2008-12-05 23:32:09 +0000 | [diff] [blame] | 19 | return g(x); |
Douglas Gregor | 5c37de7 | 2008-12-06 00:22:45 +0000 | [diff] [blame] | 20 | h(x); // h is a dependent name |
Douglas Gregor | fa04764 | 2009-02-04 00:32:51 +0000 | [diff] [blame] | 21 | g(1, 1); // expected-error{{no matching function for call}} |
Douglas Gregor | 1733001 | 2009-02-04 15:01:18 +0000 | [diff] [blame] | 22 | h(1); // expected-error{{no matching function for call to 'h'}} |
Douglas Gregor | 898574e | 2008-12-05 23:32:09 +0000 | [diff] [blame] | 23 | return 0; |
| 24 | } |