gcc/testsuite/g++.dg/cpp0x/error3.C
raw| 1 | // PR c++/47336 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template <typename T> |
| 5 | void g(T t) |
| 6 | { |
| 7 | t+1; // { dg-error "no match" } |
| 8 | } |
| 9 | |
| 10 | template <typename S> |
| 11 | class C |
| 12 | { |
| 13 | struct D {} d; |
| 14 | public: |
| 15 | decltype(g(d)) h() |
| 16 | { |
| 17 | return g(d); |
| 18 | } |
| 19 | }; |
| 20 | |
| 21 | int main() |
| 22 | { |
| 23 | C<int>().h(); |
| 24 | } |