diff options
author | Martin Sebor <msebor@redhat.com> | 2019-08-01 23:45:36 +0000 |
---|---|---|
committer | Martin Sebor <msebor@gcc.gnu.org> | 2019-08-01 17:45:36 -0600 |
commit | b74f15a88ee1a2b96784803f0e38c386796ee704 (patch) | |
tree | 7c4a96774ea3cef422ba9596824ceb090bf0ff21 /gcc/tree.h | |
parent | f3b4eae6c3ac560f28f2d1d209ae5e0e030f95fe (diff) | |
download | gcc-b74f15a88ee1a2b96784803f0e38c386796ee704.zip gcc-b74f15a88ee1a2b96784803f0e38c386796ee704.tar.gz gcc-b74f15a88ee1a2b96784803f0e38c386796ee704.tar.bz2 |
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.
From-SVN: r273989
Diffstat (limited to 'gcc/tree.h')
-rw-r--r-- | gcc/tree.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -4623,6 +4623,12 @@ extern tree first_field (const_tree); extern bool initializer_zerop (const_tree, bool * = NULL); extern bool initializer_each_zero_or_onep (const_tree); +/* Analogous to initializer_zerop but also examines the type for + which the initializer is being used. Unlike initializer_zerop, + considers empty strings to be zero initializers for arrays and + non-zero for pointers. */ +extern bool type_initializer_zero_p (tree, tree); + extern wide_int vector_cst_int_elt (const_tree, unsigned int); extern tree vector_cst_elt (const_tree, unsigned int); |