PRs 118673 and 118285 are wrong-code bugs with the transformation to build
an initializer_list backing array from a static array of the initializer
expressions; let's disable that transformation on the GCC 14 branch.
PR c++/118673
PR c++/118285
gcc/cp/ChangeLog:
* call.cc (convert_like_internal) [ck_list]: Stop using
maybe_init_list_as_array for GCC 14.
gcc/testsuite/ChangeLog:
* g++.dg/tree-ssa/initlist-opt5.C: Add xfail.
unsigned len = CONSTRUCTOR_NELTS (expr);
tree array;
- if (tree init = maybe_init_list_as_array (elttype, expr))
- {
- elttype = cp_build_qualified_type
- (elttype, cp_type_quals (elttype) | TYPE_QUAL_CONST);
- array = build_array_of_n_type (elttype, len);
- array = build_vec_init_expr (array, init, complain);
- array = get_target_expr (array);
- array = cp_build_addr_expr (array, complain);
- }
- else if (len)
+ if (len)
{
tree val; unsigned ix;
// { dg-do compile { target c++11 } }
// Check that we call the basic_string constructor once (and define it once).
-// { dg-final { scan-tree-dump-times {>::basic_string} 2 "gimple" } }
+// { dg-final { scan-tree-dump-times {>::basic_string} 2 "gimple" { xfail *-*-* } } }
#include <string>