Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/concepts-placeholder8.C

raw
1 // { dg-do compile { target c++20 } }
2
3 template <class T> concept is_const = __is_same(T, const T);
4
5 void f() {
6 int x[] = {1,2};
7 const int y[] = {3};
8 const is_const auto [a,b] = x; // { dg-error "structured binding declaration cannot have constrained 'auto' type 'const auto \\\[requires ::is_const<<placeholder>, >\\\]'" }
9 // { dg-error "constraints" "" { target *-*-* } .-1 }
10 const is_const auto [c] = y; // { dg-error "structured binding declaration cannot have constrained 'auto' type 'const auto \\\[requires ::is_const<<placeholder>, >\\\]'" }
11 }