- tmp = initialize_reference (type, init, decl, cleanup, tf_warning_or_error);
-
- if (tmp == error_mark_node)
- return NULL_TREE;
- else if (tmp == NULL_TREE)
- {
- error ("cannot initialize %qT from %qT", type, TREE_TYPE (init));
- return NULL_TREE;
- }
-
- if (TREE_STATIC (decl) && !TREE_CONSTANT (tmp))
- return tmp;
-
- DECL_INITIAL (decl) = tmp;
-
- return NULL_TREE;
-}
-
-/* Subroutine of check_initializer. We're initializing a DECL of
- std::initializer_list<T> TYPE from a braced-init-list INIT, and need to
- extend the lifetime of the underlying array to match that of the decl,
- just like for reference initialization. CLEANUP is as for
- grok_reference_init. */
-
-static tree
-build_init_list_var_init (tree decl, tree type, tree init, tree *array_init,
- tree *cleanup)
-{
- tree aggr_init, array, arrtype;
- init = perform_implicit_conversion (type, init, tf_warning_or_error);
- if (error_operand_p (init))
- return error_mark_node;
-
- aggr_init = TARGET_EXPR_INITIAL (init);
- array = CONSTRUCTOR_ELT (aggr_init, 0)->value;
- arrtype = TREE_TYPE (array);
- STRIP_NOPS (array);
- gcc_assert (TREE_CODE (array) == ADDR_EXPR);
- array = TREE_OPERAND (array, 0);
- /* If the array is constant, finish_compound_literal already made it a
- static variable and we don't need to do anything here. */
- if (decl && TREE_CODE (array) == TARGET_EXPR)
- {
- tree var = set_up_extended_ref_temp (decl, array, cleanup, array_init);
- var = build_address (var);
- var = convert (arrtype, var);
- CONSTRUCTOR_ELT (aggr_init, 0)->value = var;
- }
- return init;