diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-08-09 09:43:00 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-08-09 09:43:00 +0000 |
commit | 0f586b9b0255b0825bfc03eb8d289165651f987b (patch) | |
tree | ead45c16d5aaf360b731048c6c6341a0c8b6d5dd | |
parent | 9371e8a0283e673a83d8f5604bf838e5b748f8c2 (diff) | |
download | gcc-0f586b9b0255b0825bfc03eb8d289165651f987b.zip gcc-0f586b9b0255b0825bfc03eb8d289165651f987b.tar.gz gcc-0f586b9b0255b0825bfc03eb8d289165651f987b.tar.bz2 |
cvt.c (convert_to_pointer_force): Fix error message when attempting to cast from ambiguous base.
* cvt.c (convert_to_pointer_force): Fix error message when
attempting to cast from ambiguous base.
From-SVN: r35586
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/cvt.c | 12 |
2 files changed, 13 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b7b7df8..9044923 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-08-09 Nathan Sidwell <nathan@codesourcery.com> + + * cvt.c (convert_to_pointer_force): Fix error message when + attempting to cast from ambiguous base. + 2000-08-08 Jason Merrill <jason@redhat.com> * pt.c (tsubst_aggr_type): Bail if creating the argvec fails. diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index 2cbbd59..2986f07 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -307,10 +307,9 @@ convert_to_pointer_force (type, expr) TREE_TYPE (intype), 0, &path); if (distance == -2) { - ambig: - cp_error ("type `%T' is ambiguous baseclass of `%s'", + cp_error ("type `%T' is ambiguous base of `%T'", TREE_TYPE (type), - TYPE_NAME_STRING (TREE_TYPE (intype))); + TREE_TYPE (intype)); return error_mark_node; } if (distance == -1) @@ -318,7 +317,12 @@ convert_to_pointer_force (type, expr) distance = get_base_distance (TREE_TYPE (intype), TREE_TYPE (type), 0, &path); if (distance == -2) - goto ambig; + { + cp_error ("type `%T' is ambiguous base of `%T'", + TREE_TYPE (intype), + TREE_TYPE (type)); + return error_mark_node; + } if (distance < 0) /* Doesn't need any special help from us. */ return build1 (NOP_EXPR, type, expr); |