gcc/libstdc++-v3/testsuite/23_containers/span
Marek Polacek a226590fef c++: explicit ctor and list-initialization [PR109159]
When I implemented explicit(bool) in r9-3735, I added this code to
add_template_candidate_real:
+  /* Now the explicit specifier might have been deduced; check if this
+     declaration is explicit.  If it is and we're ignoring non-converting
+     constructors, don't add this function to the set of candidates.  */
+  if ((flags & LOOKUP_ONLYCONVERTING) && DECL_NONCONVERTING_P (fn))
+    return NULL;
but as this test demonstrates, that's incorrect when we're initializing
from a {}: for list-initialization we consider explicit constructors and
complain if one is chosen.

	PR c++/109159

gcc/cp/ChangeLog:

	* call.cc (add_template_candidate_real): Add explicit decls to the
	set of candidates when the initializer is a braced-init-list.

libstdc++-v3/ChangeLog:

	* testsuite/20_util/pair/cons/explicit_construct.cc: Adjust dg-error.
	* testsuite/20_util/tuple/cons/explicit_construct.cc: Likewise.
	* testsuite/23_containers/span/explicit.cc: Likewise.

gcc/testsuite/ChangeLog:

	* g++.dg/cpp0x/explicit16.C: New test.
2023-03-20 16:54:11 -04:00
..
1.cc
2.cc
101411.cc
back_assert_neg.cc
back_neg.cc
cons_1_assert_neg.cc
cons_2_assert_neg.cc
contiguous_range_neg.cc
deduction.cc
everything.cc
explicit.cc
first_2_assert_neg.cc
first_assert_neg.cc
first_neg.cc
front_assert_neg.cc
front_neg.cc
index_op_assert_neg.cc
index_op_neg.cc
last_2_assert_neg.cc
last_assert_neg.cc
last_neg.cc
layout_compat.cc
lwg3255.cc
nothrow_cons.cc
subspan_2_assert_neg.cc
subspan_3_assert_neg.cc
subspan_4_assert_neg.cc
subspan_5_assert_neg.cc
subspan_6_assert_neg.cc
subspan_assert_neg.cc
subspan_neg.cc
trivially_copyable.cc