From f6a7cfd28d7b04e17f42d20bd420031838b53a7a Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Sun, 30 May 1999 21:50:51 +0000 Subject: lex.c (make_lang_type): Create TYPE_BINFO for TEMPLATE_TYPE_PARMs just like for non-template types. * lex.c (make_lang_type): Create TYPE_BINFO for TEMPLATE_TYPE_PARMs just like for non-template types. From-SVN: r27259 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/lex.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 99f2635..fd820e2 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1999-05-30 Mark Mitchell + * lex.c (make_lang_type): Create TYPE_BINFO for + TEMPLATE_TYPE_PARMs just like for non-template types. + * decl.c (start_decl): Move checks on initialization to ... (cp_finish_decl): Here. Tidy formatting slightly. diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c index 9d074ca..80f855e 100644 --- a/gcc/cp/lex.c +++ b/gcc/cp/lex.c @@ -4680,7 +4680,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 @@ -4698,6 +4697,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; } -- cgit v1.1