* class.c (build_base_field): Set DECL_PACKED.
(layout_class_type): Don't use tail padding of PODs.
* mangle.c (write_unqualified_name): Fix template conversion op
mangling.
From-SVN: r54747
+2002-06-14 Jason Merrill <jason@redhat.com>
+
+ C++ ABI changes.
+ * class.c (build_base_field): Set DECL_PACKED.
+ (layout_class_type): Don't use tail padding of PODs.
+ * mangle.c (write_unqualified_name): Fix template conversion op
+ mangling.
+
2002-06-16 Richard Henderson <rth@redhat.com>
PR opt/6793
DECL_SIZE_UNIT (decl) = CLASSTYPE_SIZE_UNIT (basetype);
DECL_ALIGN (decl) = CLASSTYPE_ALIGN (basetype);
DECL_USER_ALIGN (decl) = CLASSTYPE_USER_ALIGN (basetype);
+ /* Tell the backend not to round up to TYPE_ALIGN. */
+ DECL_PACKED (decl) = 1;
if (!integer_zerop (DECL_SIZE (decl)))
{
CLASSTYPE_SIZE (t) = bitsize_zero_node;
CLASSTYPE_SIZE_UNIT (t) = size_zero_node;
}
+ /* If this is a POD, we can't reuse its tail padding. */
+ else if (!CLASSTYPE_NON_POD_P (t))
+ {
+ CLASSTYPE_SIZE (t) = TYPE_SIZE (t);
+ CLASSTYPE_SIZE_UNIT (t) = TYPE_SIZE_UNIT (t);
+ }
else
{
CLASSTYPE_SIZE (t) = TYPE_BINFO_SIZE (t);
{
/* Conversion operator. Handle it right here.
<operator> ::= cv <type> */
+ tree type;
+ if (decl_is_template_id (decl, NULL))
+ {
+ tree fn_type = get_mostly_instantiated_function_type (decl, NULL,
+ NULL);
+ type = TREE_TYPE (fn_type);
+ }
+ else
+ type = TREE_TYPE (DECL_NAME (decl));
write_string ("cv");
- write_type (TREE_TYPE (DECL_NAME (decl)));
+ write_type (type);
}
else if (DECL_OVERLOADED_OPERATOR_P (decl))
{