Debian Codegraph @

gcc/testsuite/g++.dg/cpp26/decomp10.C

raw
1 // P0963R3 - Structured binding declaration as a condition
2 // { dg-do compile { target c++11 } }
3 // { dg-options "" }
4
5 _Complex int c;
6 int __attribute__((__vector_size__ (4 * sizeof (int)))) v;
7
8 void
9 foo ()
10 {
11 if (auto [i,j] = c) // { dg-warning "structured bindings in conditions only available with" "" { target c++23_down } }
12 ;
13 if (auto [i,j,k,l] = v) // { dg-warning "structured bindings in conditions only available with" "" { target c++23_down } }
14 ; // { dg-error "could not convert '<structured bindings>' from '\[^\n\r]*' to 'bool'" "" { target *-*-* } .-1 }
15 }