gcc/testsuite/g++.dg/cpp1z/class-deduction33.C
raw| 1 | // { dg-do compile { target c++17 } } |
| 2 | |
| 3 | template <class,class> struct same; |
| 4 | template <class T> struct same<T,T> {}; |
| 5 | |
| 6 | template <class T = void> struct A { }; |
| 7 | template <class T> struct B { B(T,T); }; |
| 8 | |
| 9 | int main() |
| 10 | { |
| 11 | same<decltype(new A),A<void>*>(); |
| 12 | same<decltype(new B{1,2}),B<int>*>(); |
| 13 | } |