// Test for decltype of direct decomposition. // { dg-do compile { target c++17 } } template struct same_type; template struct same_type {}; struct A { int i; const int ci = 42; mutable int mi; int& r = i; const int& cr = ci; } a; void f() { auto [i,ci,mi,r,cr] = a; same_type{}; same_type{}; same_type{}; same_type{}; same_type{}; } void frr() { auto &&[i,ci,mi,r,cr] = a; same_type{}; same_type{}; same_type{}; same_type{}; same_type{}; } void fc() { const auto [i,ci,mi,r,cr] = a; same_type{}; same_type{}; same_type{}; same_type{}; same_type{}; } void frc() { const A ca{}; auto &[i,ci,mi,r,cr] = ca; same_type{}; same_type{}; same_type{}; same_type{}; same_type{}; }