aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/lex.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/lex.c')
-rw-r--r--gcc/cp/lex.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index db8fdd50db2..13b5b530e76 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -4674,7 +4674,6 @@ make_lang_type (code)
TYPE_LANG_SPECIFIC (t) = pi;
SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
- TYPE_BINFO (t) = make_binfo (integer_zero_node, t, NULL_TREE, NULL_TREE);
/* Make sure this is laid out, for ease of use later. In the
presence of parse errors, the normal was of assuring this
@@ -4692,6 +4691,13 @@ make_lang_type (code)
clear it here. */
TYPE_ALIAS_SET (t) = 0;
+ /* We need to allocate a TYPE_BINFO even for TEMPALTE_TYPE_PARMs
+ since they can be virtual base types, and we then need a
+ canonical binfo for them. Ideally, this would be done lazily for
+ all types. */
+ if (IS_AGGR_TYPE_CODE (code) || code == TEMPLATE_TYPE_PARM)
+ TYPE_BINFO (t) = make_binfo (integer_zero_node, t, NULL_TREE, NULL_TREE);
+
return t;
}