diff options
author | Jason Merrill <jason@yorick.cygnus.com> | 1998-06-10 21:12:16 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1998-06-10 17:12:16 -0400 |
commit | e76e4a6842e855c0be437fcb1d0079e9323d8231 (patch) | |
tree | 717ab8487052d158d7a8e0f9afc37af8d0ff3ff4 /gcc | |
parent | d60ab851454d68a80339600fa6b333f43cc93e96 (diff) | |
download | gcc-e76e4a6842e855c0be437fcb1d0079e9323d8231.zip gcc-e76e4a6842e855c0be437fcb1d0079e9323d8231.tar.gz gcc-e76e4a6842e855c0be437fcb1d0079e9323d8231.tar.bz2 |
* search.c (covariant_return_p): Complain about ambiguous base.
From-SVN: r20420
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 2 | ||||
-rw-r--r-- | gcc/cp/search.c | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5259df0..0b67eb5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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> diff --git a/gcc/cp/search.c b/gcc/cp/search.c index 4bece8b..1478f23 100644 --- a/gcc/cp/search.c +++ b/gcc/cp/search.c @@ -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; |