gcc/testsuite/g++.dg/cpp0x/pr54318.C
raw| 1 | // PR c++/54318 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | template <typename T> |
| 5 | struct wrapped |
| 6 | { |
| 7 | typedef T type; |
| 8 | }; |
| 9 | |
| 10 | template <typename T> |
| 11 | typename T::type unwrap1(T); |
| 12 | |
| 13 | int unwrap(int); |
| 14 | |
| 15 | template <typename T> |
| 16 | auto unwrap(T t) -> decltype(unwrap(unwrap1(t))) |
| 17 | { |
| 18 | return unwrap(unwrap1(t)); |
| 19 | } |
| 20 | |
| 21 | int main() |
| 22 | { |
| 23 | unwrap(wrapped<wrapped<int>>()); |
| 24 | } |