re PR c++/83205 (ICE on structured binding with ill-formed negative std::tuple_size...
authorJakub Jelinek <jakub@redhat.com>
Fri, 15 Dec 2017 21:40:45 +0000 (22:40 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 15 Dec 2017 21:40:45 +0000 (22:40 +0100)
commit38f4bea834ef4c25cd89c824f15ee8d6b30a3760
tree4b137515b1818687477804ac20f81ccca104b582
parent70356f771a65b378362b08d5fdb926fbb88e4aa7
re PR c++/83205 (ICE on structured binding with ill-formed negative std::tuple_size<T>::value)

PR c++/83205
* decl.c (cp_finish_decomp): Handle the case when tsize is not
error_mark_node, but doesn't fit into uhwi.  Split up count != eltscnt
and !tree_fits_uhwi_p (tsize) error_at calls into error_n and inform_n
to handle plural forms properly.

* g++.dg/cpp1z/decomp3.C: Adjust for structured binding count
mismatch diagnostics split into error and warning with plural
forms.
* g++.dg/cpp1z/decomp10.C: Likewise.
* g++.dg/cpp1z/decomp32.C: New test.

From-SVN: r255706
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/decomp10.C
gcc/testsuite/g++.dg/cpp1z/decomp3.C
gcc/testsuite/g++.dg/cpp1z/decomp32.C [new file with mode: 0644]