aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index a3913f4..ba96113 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -6715,6 +6715,10 @@ layout_class_type (tree t, tree *virtuals_p)
/* T needs a different layout as a base (eliding virtual bases
or whatever). Create that version. */
tree base_t = make_node (TREE_CODE (t));
+ tree base_d = create_implicit_typedef (as_base_identifier, base_t);
+
+ TYPE_CONTEXT (base_t) = t;
+ DECL_CONTEXT (base_d) = t;
/* If the ABI version is not at least two, and the last
field was a bit-field, RLI may not be on a byte
@@ -6751,6 +6755,9 @@ layout_class_type (tree t, tree *virtuals_p)
if (TREE_CODE (field) == FIELD_DECL)
{
*next_field = copy_node (field);
+ /* Zap any NSDMI, it's not needed and might be a deferred
+ parse. */
+ DECL_INITIAL (*next_field) = NULL_TREE;
DECL_CONTEXT (*next_field) = base_t;
next_field = &DECL_CHAIN (*next_field);
}
@@ -6760,8 +6767,6 @@ layout_class_type (tree t, tree *virtuals_p)
needs a mode. */
compute_record_mode (base_t);
- TYPE_CONTEXT (base_t) = t;
-
/* Record the base version of the type. */
CLASSTYPE_AS_BASE (t) = base_t;
}