Douglas Gregor | b485046 | 2009-05-14 23:26:13 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
| 2 | |
| 3 | template<typename T, typename U> |
| 4 | struct X0 { |
| 5 | void f(T x, U y) { |
| 6 | x + y; // expected-error{{invalid operands}} |
| 7 | } |
| 8 | }; |
| 9 | |
| 10 | struct X1 { }; |
| 11 | |
| 12 | template struct X0<int, float>; |
| 13 | template struct X0<int*, int>; |
| 14 | template struct X0<int X1::*, int>; // expected-note{{instantiation of}} |
Douglas Gregor | 0555e5f | 2009-05-14 23:40:54 +0000 | [diff] [blame^] | 15 | |
| 16 | template<typename T> |
| 17 | struct X2 { |
| 18 | void f(T); |
| 19 | |
| 20 | T g(T x, T y) { |
| 21 | /* NullStmt */; |
| 22 | } |
| 23 | }; |
| 24 | |
| 25 | template struct X2<int>; |