gcc/testsuite/g++.dg/cpp1z/class-deduction104.C
raw| 1 | // PR c++/82632 |
| 2 | // { dg-do compile { target c++17 } } |
| 3 | |
| 4 | template<class T> struct Optional { |
| 5 | template<class U> Optional(U&&); |
| 6 | }; |
| 7 | |
| 8 | template<class A> Optional(A) -> Optional<A>; |
| 9 | |
| 10 | Optional opt(1729); |
| 11 | Optional dupe(opt); |
| 12 | |
| 13 | using ty1 = decltype(opt); |
| 14 | using ty1 = Optional<int>; |
| 15 | |
| 16 | using ty2 = decltype(dupe); |
| 17 | using ty2 = Optional<int>; |