Hi! When compiling this testcase with trunk clang++, I've noticed the error is different, because there are in fact 2 errors, one that a struct has 2 non-static data members and the decomposition just one identifier, the other that one of those non-static data members is private.
I've committed as obvious a change which makes the number of identifiers correct, so there is just a single reason to diagnose on that line. 2017-01-11 Jakub Jelinek <ja...@redhat.com> * g++.dg/cpp1z/decomp4.C (test): Use 2 identifier decomposition instead of just 1 for the decomposition from struct C. --- gcc/testsuite/g++.dg/cpp1z/decomp4.C.jj 2016-11-14 08:52:18.000000000 +0100 +++ gcc/testsuite/g++.dg/cpp1z/decomp4.C 2017-01-11 12:03:54.244784029 +0100 @@ -18,7 +18,7 @@ test (A &a, B &b, C &c, D &d, E &e, F &f // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } auto [ k ] { b }; // { dg-error "cannot decompose class type 'B' because it has an anonymous union member" } // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } - auto [ l ] = c; // { dg-error "cannot decompose non-public member 'C::b' of 'C'" } + auto [ l, l2 ] = c; // { dg-error "cannot decompose non-public member 'C::b' of 'C'" } // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } .-1 } auto [ m ] = d; // { dg-warning "decomposition declaration only available with -std=c..1z or -std=gnu..1z" "" { target c++14_down } } auto [ n ] { e }; // { dg-error "cannot decompose non-public member 'E::a' of 'E'" } Jakub