return fntype;
if (TREE_CODE (fntype) == FUNCTION_TYPE)
- newtype = build_function_type (new_ret, args);
+ {
+ newtype = build_function_type (new_ret, args);
+ newtype = apply_memfn_quals (newtype, type_memfn_quals (fntype));
+ }
else
newtype = build_method_type_directly
(TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype))),
DECL_INITIAL (decl) = init;
DECL_IN_AGGR_P (decl) = 1;
+ if (TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE
+ && TYPE_DOMAIN (TREE_TYPE (decl)) == NULL_TREE)
+ SET_VAR_HAD_UNKNOWN_BOUND (decl);
+
cp_finish_decl (decl, init, init_const_expr_p, asmspec_tree, flags);
}
{
inner = cp_reconstruct_complex_type (TREE_TYPE (type), bottom);
outer = build_function_type (inner, TYPE_ARG_TYPES (type));
+ outer = apply_memfn_quals (outer, type_memfn_quals (type));
}
else if (TREE_CODE (type) == METHOD_TYPE)
{
if (TYPE_ATTRIBUTES (type))
outer = cp_build_type_attribute_variant (outer, TYPE_ATTRIBUTES (type));
- return cp_build_qualified_type (outer, TYPE_QUALS (type));
+ return cp_build_qualified_type (outer, cp_type_quals (type));
}
/* Like decl_attributes, but handle C++ complexity. */
tree vtbl;
tree primary_vtbl;
int needed = 0;
+ struct varpool_node *current = NULL, *last = NULL, *first = NULL;
/* If the vtables for this class have already been emitted there is
nothing more to do. */
actually marking the variable as written. */
if (flag_syntax_only)
TREE_ASM_WRITTEN (vtbl) = 1;
+ else if (DECL_COMDAT (vtbl))
+ {
+ current = varpool_node (vtbl);
+ if (last)
+ last->same_comdat_group = current;
+ last = current;
+ if (!first)
+ first = current;
+ }
}
+ if (first != last)
+ last->same_comdat_group = first;
+
/* Since we're writing out the vtable here, also write the debug
info. */
note_debug_info_needed (ctype);
cgraph_mark_address_taken_node (cgraph_node (BASELINK_FUNCTIONS (t)));
break;
case VAR_DECL:
- if (DECL_VTABLE_OR_VTT_P (t))
- {
- /* The ABI requires that all virtual tables be emitted
- whenever one of them is. */
- tree vtbl;
- for (vtbl = CLASSTYPE_VTABLES (DECL_CONTEXT (t));
- vtbl;
- vtbl = TREE_CHAIN (vtbl))
- mark_decl_referenced (vtbl);
- }
- else if (DECL_CONTEXT (t)
- && flag_use_repository
- && TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL)
+ if (DECL_CONTEXT (t)
+ && flag_use_repository
+ && TREE_CODE (DECL_CONTEXT (t)) == FUNCTION_DECL)
/* If we need a static variable in a function, then we
need the containing function. */
mark_decl_referenced (DECL_CONTEXT (t));