Hi,

On 12/12/2013 03:19 PM, Jason Merrill wrote:
I wouldn't expect it to cause problems.
Ok. Then I looked a bit into this and something is making me nervous: lookup_base wants to return a binfo, not a type. Thus what do we do when the type is incomplete and there is no binfo? Something like the below "works" but it doesn't seem right vs multiple call of the function with the same arguments. Conservatively but still more neatly than my first try, we could maybe use same_type_ignoring_top_level_qualifiers_p in the definition of the DERIVED_FROM_P macro?

Thanks,
Paolo.

////////////////
Index: search.c
===================================================================
--- search.c    (revision 206218)
+++ search.c    (working copy)
@@ -242,6 +242,12 @@ lookup_base (tree t, tree base, base_access access
       else
        bk = bk_proper_base;
     }
+  else if (CLASS_TYPE_P (base) && same_type_p (TYPE_MAIN_VARIANT (t), base))
+    {
+      binfo = make_tree_binfo (0);
+      BINFO_TYPE (binfo) = base;
+      bk = bk_same_type;
+    }
   else
     {
       binfo = NULL_TREE;

Reply via email to