Commit 0f586b9b by Nathan Sidwell Committed by Nathan Sidwell

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
parent 9371e8a0
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> 2000-08-08 Jason Merrill <jason@redhat.com>
* pt.c (tsubst_aggr_type): Bail if creating the argvec fails. * pt.c (tsubst_aggr_type): Bail if creating the argvec fails.
......
...@@ -307,10 +307,9 @@ convert_to_pointer_force (type, expr) ...@@ -307,10 +307,9 @@ convert_to_pointer_force (type, expr)
TREE_TYPE (intype), 0, &path); TREE_TYPE (intype), 0, &path);
if (distance == -2) if (distance == -2)
{ {
ambig: cp_error ("type `%T' is ambiguous base of `%T'",
cp_error ("type `%T' is ambiguous baseclass of `%s'",
TREE_TYPE (type), TREE_TYPE (type),
TYPE_NAME_STRING (TREE_TYPE (intype))); TREE_TYPE (intype));
return error_mark_node; return error_mark_node;
} }
if (distance == -1) if (distance == -1)
...@@ -318,7 +317,12 @@ convert_to_pointer_force (type, expr) ...@@ -318,7 +317,12 @@ convert_to_pointer_force (type, expr)
distance = get_base_distance (TREE_TYPE (intype), distance = get_base_distance (TREE_TYPE (intype),
TREE_TYPE (type), 0, &path); TREE_TYPE (type), 0, &path);
if (distance == -2) 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) if (distance < 0)
/* Doesn't need any special help from us. */ /* Doesn't need any special help from us. */
return build1 (NOP_EXPR, type, expr); return build1 (NOP_EXPR, type, expr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment