This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/83205] ICE on structured binding with ill-formed negative std::tuple_size<T>::value


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83205

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Fri Dec 15 21:40:45 2017
New Revision: 255706

URL: https://gcc.gnu.org/viewcvs?rev=255706&root=gcc&view=rev
Log:
        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.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1z/decomp32.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp1z/decomp10.C
    trunk/gcc/testsuite/g++.dg/cpp1z/decomp3.C

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]