c++: alias template equivalence and CTAD [PR103852]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1z / class-deduction-alias1.C
blobffa5f2bad945a0fec3bd40106911b0bf5f8db966
1 // PR c++/103852
2 // { dg-do compile { target c++17 } }
3 // { dg-options "" }
5 template <class T> struct b{};
6 template <class T, class T1 = b<T>>
7 struct s
9     s(T);
11 s c(100);
12 template <class T, class T1 = b<T>>
13 using ss = s<T, T1>;         // equivalent under proposed resolution of DR 1286
14 ss tt(1);   // { dg-warning "alias template deduction" "" { target c++17_only } }
16 template <class T, class T1 = T>
17 using ss2 = s<T, T1>;        // different default arg makes it non-equivalent
18 ss2 tt2(1); // { dg-error "alias template deduction" "" { target c++17_only } }