// See commentary in test/Parser/decomposed-condition.cpp
for(;auto[a,b,c]=S();){}// expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{value of type 'S' is not contextually convertible to 'bool'}}
if(auto[a,b,c]=S()){}// expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{value of type 'S' is not contextually convertible to 'bool'}}
if(intn;auto[a,b,c]=S()){}// expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{value of type 'S' is not contextually convertible to 'bool'}}
switch(auto[a,b,c]=S()){}// expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{statement requires expression of integer type ('S' invalid)}}
switch(intn;auto[a,b,c]=S()){}// expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{statement requires expression of integer type ('S' invalid)}}
while(auto[a,b,c]=S()){}// expected-warning {{ISO C++17 does not permit structured binding declaration in a condition}} expected-error {{value of type 'S' is not contextually convertible to 'bool'}}
auto[e][1]=s;// expected-error {{expected ';'}} expected-error {{requires an initializer}}
// FIXME: This should fire the 'misplaced array declarator' diagnostic.
int[K]arr={0};// expected-error {{expected ';'}} expected-error {{cannot be declared with type 'int'}} expected-error {{decomposition declaration '[K]' requires an initializer}}
int[5]arr={0};// expected-error {{place the brackets after the name}}
auto*[f]=s;// expected-error {{cannot be declared with type 'auto *'}} expected-error {{incompatible initializer}}
autoS::*[g]=s;// expected-error {{cannot be declared with type 'auto BadSpecifiers::S::*'}} expected-error {{incompatible initializer}}
// ref-qualifiers are OK.
auto&&[ok_1]=S();
auto&[ok_2]=s;
// attributes are OK.
[[]]auto[ok_3]=s;
alignas(S)auto[ok_4]=s;
// ... but not after the identifier or declarator.
// FIXME: These errors are not very good.
auto[bad_attr_1[[]]]=s;// expected-error {{attribute list cannot appear here}} expected-error 2{{}}