summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/decomp17.C
blob: ace1f06a5a7bbf9cb9e308b3bb82cba3efde5ab6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-options -std=c++17 }

#include <tuple>

template <typename, typename> struct same_type;
template <typename T> struct same_type<T, T> {};

int main() {
  int i;
  std::tuple<int,int&,int&&> tuple = { 1, i, 1 };
  auto &[v, r, rr] = tuple;
  same_type<decltype(v), int>{};
  same_type<decltype(r), int&>{};
  same_type<decltype(rr), int&&>{};
}