if (TREE_CODE (type) == ARRAY_TYPE)
cp_complete_array_type (&type, compound_literal, false);
compound_literal = digest_init (type, compound_literal);
- if ((!at_function_scope_p () || CP_TYPE_CONST_P (type))
+ if ((!at_function_scope_p () || cp_type_readonly (type))
&& initializer_constant_valid_p (compound_literal, type))
{
tree decl = create_temporary_var (type);
if (TREE_CODE (type) != REFERENCE_TYPE)
{
if (!LAMBDA_EXPR_MUTABLE_P (lam))
- type = cp_build_qualified_type (type, (cp_type_quals (type)
+ type = cp_build_qualified_type (type, (TYPE_QUALS (type)
|TYPE_QUAL_CONST));
type = build_reference_type (type);
}
start_preparsed_function (convfn, NULL_TREE,
SF_PRE_PARSED | SF_INCLASS_INLINE);
+ if (DECL_ONE_ONLY (statfn))
+ {
+ /* Put the thunk in the same comdat group as the call op. */
+ struct cgraph_node *callop_node, *thunk_node;
+ DECL_COMDAT_GROUP (statfn) = DECL_COMDAT_GROUP (callop);
+ callop_node = cgraph_node (callop);
+ thunk_node = cgraph_node (statfn);
+ gcc_assert (callop_node->same_comdat_group == NULL);
+ gcc_assert (thunk_node->same_comdat_group == NULL);
+ callop_node->same_comdat_group = thunk_node;
+ thunk_node->same_comdat_group = callop_node;
+ }
body = begin_function_body ();
compound_stmt = begin_compound_stmt (0);