diff options
author | Jason Merrill <jason@redhat.com> | 2023-01-23 15:03:47 -0500 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2023-01-23 16:12:52 -0500 |
commit | 72e46b3c7ad5e3d2c69868a510c00707c356106a (patch) | |
tree | 218c54255f31d8b9e40755b49935af4a9349564e /gcc/cp | |
parent | 771d793df1622a476e1cf8d05f0a6aee350fa56b (diff) | |
download | gcc-72e46b3c7ad5e3d2c69868a510c00707c356106a.zip gcc-72e46b3c7ad5e3d2c69868a510c00707c356106a.tar.gz gcc-72e46b3c7ad5e3d2c69868a510c00707c356106a.tar.bz2 |
c++: vector of class with bool ctor [PR108195]
The transformation done by r13-4564 to use the iterator constructor instead
of the initializer-list constructor breaks if the iterator pointers are
themselves treated as elements of an initializer-list, so check for that.
PR c++/108195
gcc/cp/ChangeLog:
* call.cc (build_user_type_conversion_1): Check whether the
iterators also find a list ctor.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/initlist-vect2.C: New test.
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/call.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/call.cc b/gcc/cp/call.cc index a7de0e8..5715a7c 100644 --- a/gcc/cp/call.cc +++ b/gcc/cp/call.cc @@ -4581,7 +4581,7 @@ build_user_type_conversion_1 (tree totype, tree expr, int flags, if (tree iters = maybe_init_list_as_range (cand->fn, expr)) if (z_candidate *cand2 = build_user_type_conversion_1 (totype, iters, flags, tf_none)) - if (cand2->viable == 1) + if (cand2->viable == 1 && !is_list_ctor (cand2->fn)) { cand = cand2; expr = iters; |