[Bug c++/90947] [9/10 Regression] Simple lookup table of array of strings is miscompiled

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 1 23:46:00 GMT 2019


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

--- Comment #5 from Martin Sebor <msebor at gcc dot gnu.org> ---
Author: msebor
Date: Thu Aug  1 23:45:36 2019
New Revision: 273989

URL: https://gcc.gnu.org/viewcvs?rev=273989&root=gcc&view=rev
Log:
PR c++/90947 - Simple lookup table of array of strings is miscompiled

gcc/cp/ChangeLog:

        PR c++/90947
        * decl.c (reshape_init_array_1): Avoid truncating initializer
        lists containing string literals.

gcc/testsuite/ChangeLog:

        PR c++/90947
        * c-c++-common/array-1.c: New test.
        * g++.dg/abi/mangle73.C: New test.
        * g++.dg/cpp2a/nontype-class23.C: New test.
        * g++.dg/init/array53.C: New test.

gcc/ChangeLog:

        PR c++/90947
        * tree.c (type_initializer_zero_p): Define.
        * tree.h (type_initializer_zero_p): New function.


Added:
    trunk/gcc/testsuite/c-c++-common/array-1.c
    trunk/gcc/testsuite/g++.dg/abi/mangle73.C
    trunk/gcc/testsuite/g++.dg/cpp2a/nontype-class23.C
    trunk/gcc/testsuite/g++.dg/init/array53.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree.c
    trunk/gcc/tree.h


More information about the Gcc-bugs mailing list