diff options
author | Mark Mitchell <mark@codesourcery.com> | 1999-05-30 21:50:51 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1999-05-30 21:50:51 +0000 |
commit | f6a7cfd28d7b04e17f42d20bd420031838b53a7a (patch) | |
tree | 1e1b40ca0a51389466120f45c1e95e5416d19f48 | |
parent | fcd3f0bc88435980d669c4dc4e21c683354b58f0 (diff) | |
download | gcc-f6a7cfd28d7b04e17f42d20bd420031838b53a7a.zip gcc-f6a7cfd28d7b04e17f42d20bd420031838b53a7a.tar.gz gcc-f6a7cfd28d7b04e17f42d20bd420031838b53a7a.tar.bz2 |
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
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/lex.c | 8 |
2 files changed, 10 insertions, 1 deletions
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 <mark@codesourcery.com> + * 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; } |