1 // Test for decltype of direct decomposition.
2 // { dg-options -std=c++17 }
4 template <class,class> struct same_type;
5 template <class T> struct same_type<T,T> {};
16 auto [i,ci,mi,r,cr] = a;
18 same_type<decltype(i),int>{};
19 same_type<decltype(ci),const int>{};
20 same_type<decltype(mi),int>{};
21 same_type<decltype(r),int&>{};
22 same_type<decltype(cr),const int&>{};
25 auto &&[i,ci,mi,r,cr] = a;
27 same_type<decltype(i),int>{};
28 same_type<decltype(ci),const int>{};
29 same_type<decltype(mi),int>{};
30 same_type<decltype(r),int&>{};
31 same_type<decltype(cr),const int&>{};
34 const auto [i,ci,mi,r,cr] = a;
36 same_type<decltype(i),const int>{};
37 same_type<decltype(ci),const int>{};
38 same_type<decltype(mi),int>{};
39 same_type<decltype(r),int&>{};
40 same_type<decltype(cr),const int&>{};
44 auto &[i,ci,mi,r,cr] = ca;
46 same_type<decltype(i),const int>{};
47 same_type<decltype(ci),const int>{};
48 same_type<decltype(mi),int>{};
49 same_type<decltype(r),int&>{};
50 same_type<decltype(cr),const int&>{};