diff options
author | Marek Polacek <polacek@redhat.com> | 2020-03-10 18:55:42 -0400 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2020-03-10 23:12:41 -0400 |
commit | e11d05c1ed26257493130762a8ae240f1bc06e87 (patch) | |
tree | 637dab153ef59698c03e1513b71568a444ca724a /gcc/tree-loop-distribution.c | |
parent | 481fcfe6fec156ca2a6baea4b623076e2eefa6a6 (diff) | |
download | gcc-e11d05c1ed26257493130762a8ae240f1bc06e87.zip gcc-e11d05c1ed26257493130762a8ae240f1bc06e87.tar.gz gcc-e11d05c1ed26257493130762a8ae240f1bc06e87.tar.bz2 |
c++: Fix wrong conversion error with non-viable overload [PR94124]
This is a bad interaction between sharing a constructor for an array
and stripping its trailing zero-initializers. Here we reuse a ctor
and then strip its 0s. This breaks overload resolution in this test:
D can be initialized from {} but not from {0}, so if we truncate the
constructor not to include the zero, the F(D) overload becomes valid
and then we get the ambiguous conversion error.
PR c++/94124 - wrong conversion error with non-viable overload.
* decl.c (reshape_init_array_1): Unshare a constructor if we
stripped trailing zero-initializers.
* g++.dg/cpp0x/initlist-overload1.C: New test.
Diffstat (limited to 'gcc/tree-loop-distribution.c')
0 files changed, 0 insertions, 0 deletions