https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122658
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GXX_TESTSUITE_STDS=98,11,14,17,20,23,26 make -j32 -k check-g++
doesn't regress anything with
--- gcc/cp/call.cc 2025-11-10 22:58:34.766352278 +0100
+++ gcc/cp/call.cc 2025-11-17 16:11:36.711665711 +0100
@@ -10328,18 +10328,11 @@ build_over_call (struct z_candidate *can
TREE_NO_WARNING (expr) = true;
if (immediate_invocation_p (fn))
{
- tree obj_arg = NULL_TREE, exprimm = expr;
+ tree obj_arg = NULL_TREE;
if (DECL_CONSTRUCTOR_P (fn))
obj_arg = first_arg;
- if (obj_arg
- && is_dummy_object (obj_arg)
- && !type_dependent_expression_p (obj_arg))
- {
- exprimm = build_cplus_new (DECL_CONTEXT (fn), expr, complain);
- obj_arg = NULL_TREE;
- }
/* Look through *(const T *)&obj. */
- else if (obj_arg && INDIRECT_REF_P (obj_arg))
+ if (obj_arg && INDIRECT_REF_P (obj_arg))
{
tree addr = TREE_OPERAND (obj_arg, 0);
STRIP_NOPS (addr);
@@ -10351,7 +10344,7 @@ build_over_call (struct z_candidate *can
obj_arg = TREE_OPERAND (addr, 0);
}
}
- fold_non_dependent_expr (exprimm, complain,
+ fold_non_dependent_expr (expr, complain,
/*manifestly_const_eval=*/true,
obj_arg);
}