]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lex.c (make_lang_type): Create TYPE_BINFO for TEMPLATE_TYPE_PARMs just like for non...
authorMark Mitchell <mark@codesourcery.com>
Sun, 30 May 1999 21:50:51 +0000 (21:50 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 30 May 1999 21:50:51 +0000 (21:50 +0000)
* lex.c (make_lang_type): Create TYPE_BINFO for
TEMPLATE_TYPE_PARMs just like for non-template types.

From-SVN: r27259

gcc/cp/ChangeLog
gcc/cp/lex.c

index 99f26355ffa969826e9647a462d33974b174cae6..fd820e23d9ce190d1938b10af4303c68dabb4417 100644 (file)
@@ -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.
 
index 9d074ca726b21872367ea578380e81fa9b070600..80f855ede3bc17d4e798b12be724a2255c8511ee 100644 (file)
@@ -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;
 }