diff options
author | Tom Greenslade (thomgree) <thomgree@cisco.com> | 2021-02-03 11:31:53 +0000 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2021-02-04 10:46:39 -0500 |
commit | e6cc142ad99ab8d28581f4ce61056c9cce74dba3 (patch) | |
tree | 36040f01624599a628e0439d9e441c8ee355ae9d /libcpp/expr.c | |
parent | aa652fb2a083c15678f82a5cb20b7f8cbc9c1437 (diff) | |
download | gcc-e6cc142ad99ab8d28581f4ce61056c9cce74dba3.zip gcc-e6cc142ad99ab8d28581f4ce61056c9cce74dba3.tar.gz gcc-e6cc142ad99ab8d28581f4ce61056c9cce74dba3.tar.bz2 |
c++: fix string literal member initializer bug [PR90926]
build_aggr_conv did not correctly handle string literal member initializers.
Extended can_convert_array to handle this case. For the additional check of
compatibility of character types, factored out code from digest_init_r into
a new function.
gcc/cp/ChangeLog:
PR c++/90926
* call.c (can_convert_array): Extend to handle all valid aggregate
initializers of an array; including by string literals, not just by
brace-init-list.
(build_aggr_conv): Call can_convert_array more often, not just in
brace-init-list case.
* typeck2.c (array_string_literal_compatible_p): New function.
(digest_init_r): call array_string_literal_compatible_p
* cp-tree.h: (array_string_literal_compatible_p): Declare.
gcc/testsuite/ChangeLog:
PR c++/90926
* g++.dg/cpp1y/nsdmi-aggr12.C: New test.
Diffstat (limited to 'libcpp/expr.c')
0 files changed, 0 insertions, 0 deletions