aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-placeholder8.C
blob: d887961227f156d21eac989e6d626f5749cc0620 (plain)
1
2
3
4
5
6
7
8
9
10
11
// { dg-do compile { target c++20 } }

template <class T> concept is_const = __is_same(T, const T);

void f() {
  int x[] = {1,2};
  const int y[] = {3};
  const is_const auto [a,b] = x;	// { dg-error "structured binding declaration cannot have constrained 'auto' type 'const auto \\\[requires ::is_const<<placeholder>, >\\\]'" }
					// { dg-error "constraints" "" { target *-*-* } .-1 }
  const is_const auto [c] = y;		// { dg-error "structured binding declaration cannot have constrained 'auto' type 'const auto \\\[requires ::is_const<<placeholder>, >\\\]'" }
}