* search.c (covariant_return_p): Complain about ambiguous base.

From-SVN: r20420
This commit is contained in:
Jason Merrill 1998-06-10 21:12:16 +00:00 committed by Jason Merrill
parent d60ab85145
commit e76e4a6842
2 changed files with 8 additions and 1 deletions

View File

@ -1,5 +1,7 @@
1998-06-10 Jason Merrill <jason@yorick.cygnus.com>
* search.c (covariant_return_p): Complain about ambiguous base.
* typeck.c (build_component_ref): Diagnose ref to nested type.
1998-06-10 Brendan Kehoe <brendan@cygnus.com>

View File

@ -2205,7 +2205,12 @@ covariant_return_p (brettype, drettype)
if (! IS_AGGR_TYPE (drettype) || ! IS_AGGR_TYPE (brettype))
return -1;
binfo = get_binfo (brettype, drettype, 0);
binfo = get_binfo (brettype, drettype, 1);
/* If we get an error_mark_node from get_binfo, it already complained,
so let's just succeed. */
if (binfo == error_mark_node)
return 1;
if (! BINFO_OFFSET_ZEROP (binfo) || TREE_VIA_VIRTUAL (binfo))
return 2;