@@ -30795,18 +30795,34 @@ previously-scanned braced initializer.
3079530795 } /* if */
3079630796 expr = expr_node_from_operand(result);
3079730797 if (expr != NULL) {
30798+ an_expr_node_ptr temp_expr = expr;
3079830799 /* Record source form information in the associated IL entries if
3079930800 needed. */
3080030801 expr->is_brace_notation_cast = TRUE;
30801- if (expr->kind == (an_expr_node_kind)enk_temp_init) {
30802- a_dynamic_init_ptr dip = expr->variant.init.dynamic_init;
30802+ if (is_any_reference_type(type_cast_to) && is_array_type(expr->type) &&
30803+ is_operation_node(expr) &&
30804+ node_operator_is(expr, eok_lvalue_adjust)) {
30805+ /* A reference bound to an array temporary, as in "R{1, 2}" with R
30806+ being "int(&&)[2]", is "*" applied to the decayed temporary (under
30807+ the eok_lvalue_adjust). Record the cast on the temporary. */
30808+ an_expr_node_ptr opnd = expr->variant.operation.operands;
30809+ if (is_operation_node(opnd) && node_operator_is(opnd, eok_indirect)) {
30810+ opnd = opnd->variant.operation.operands;
30811+ if (is_operation_node(opnd) &&
30812+ node_operator_is(opnd, eok_array_to_pointer)) {
30813+ temp_expr = opnd->variant.operation.operands;
30814+ } /* if */
30815+ } /* if */
30816+ } /* if */
30817+ if (node_is(temp_expr, enk_temp_init)) {
30818+ a_dynamic_init_ptr dip = temp_expr->variant.init.dynamic_init;
3080330819 dip->is_explicit_cast = TRUE;
3080430820 dip->is_braced_initializer = TRUE;
3080530821 if (dip->kind == (a_dynamic_init_kind)dik_constant ||
3080630822 dip->kind == (a_dynamic_init_kind)dik_nonconstant_aggregate) {
3080730823 dip->variant.constant.ptr->explicit_cast_applied = TRUE;
3080830824 } /* if */
30809- expr ->variant.init.source.type = type_cast_to;
30825+ temp_expr ->variant.init.source.type = type_cast_to;
3081030826 } /* if */
3081130827 } /* if */
3081230828#if EXTRA_SOURCE_POSITIONS_IN_IL
0 commit comments