gcc/testsuite/g++.dg/cpp0x/decltype34.C
raw| 1 | // PR c++/50870 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | struct impl |
| 5 | { |
| 6 | template <class T> static T create(); |
| 7 | }; |
| 8 | |
| 9 | template<class T, class U, |
| 10 | class = decltype(impl::create<T>()->impl::create<U>())> |
| 11 | struct tester{}; |
| 12 | |
| 13 | tester<impl*, int> ti; |
| 14 | |
| 15 | template<class T, class U, |
| 16 | class = decltype(impl::create<T>()->impl::create<U>())> |
| 17 | int test() { return 0; } |
| 18 | |
| 19 | int i = test<impl*, int>(); |