1 // { dg-options -std=c++17 } 2 3 #include <tuple> 4 5 template <typename, typename> struct same_type; 6 template <typename T> struct same_type<T, T> {}; 7 8 int main() { 9 int i; 10 std::tuple<int,int&,int&&> tuple = { 1, i, 1 }; 11 auto &[v, r, rr] = tuple; 12 same_type<decltype(v), int>{}; 13 same_type<decltype(r), int&>{}; 14 same_type<decltype(rr), int&&>{}; 15 } 16