gcc/testsuite/g++.dg/cpp0x/error4.C
raw| 1 | // PR c++/49156 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template<typename T> T declval(); |
| 5 | |
| 6 | template<typename T> |
| 7 | struct S { |
| 8 | |
| 9 | template<typename U> |
| 10 | static U get(const volatile T&); |
| 11 | |
| 12 | template<typename U> |
| 13 | static decltype(*declval<U>()) get(...); // { dg-error "operator*" } |
| 14 | |
| 15 | typedef decltype(get<T>(declval<T>())) type; // { dg-error "" } |
| 16 | }; |
| 17 | |
| 18 | struct X { }; |
| 19 | |
| 20 | S<X>::type x; |
| 21 | |
| 22 | // { dg-prune-output "note" } |