gcc/testsuite/g++.dg/cpp1z/class-deduction42.C
raw| 1 | // { dg-do compile { target c++17 } } |
| 2 | |
| 3 | #include <initializer_list> |
| 4 | |
| 5 | template <class,class> struct same; |
| 6 | template <class T> struct same<T,T> { }; |
| 7 | |
| 8 | template <class T> |
| 9 | struct A |
| 10 | { |
| 11 | A(const A&); |
| 12 | A(std::initializer_list<T>); |
| 13 | }; |
| 14 | |
| 15 | A a { 1 }; |
| 16 | A b { a }; |
| 17 | |
| 18 | same<decltype (a), decltype (b)> s; |
| 19 |