]> gcc.gnu.org Git - gcc.git/commitdiff
cvt.c (convert_to_pointer_force): Fix error message when attempting to cast from...
authorNathan Sidwell <nathan@codesourcery.com>
Wed, 9 Aug 2000 09:43:00 +0000 (09:43 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 9 Aug 2000 09:43:00 +0000 (09:43 +0000)
* cvt.c (convert_to_pointer_force): Fix error message when
attempting to cast from ambiguous base.

From-SVN: r35586

gcc/cp/ChangeLog
gcc/cp/cvt.c

index b7b7df82013d3f435cb0eb59008db3cad5739bc1..9044923b7cc06ae4351457ca1fcfa1028a56ecdb 100644 (file)
@@ -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.
index 2cbbd59d47680316a33c494c407e900e0ac00966..2986f07c2afd9753507f66c9ff8d88e127b569f8 100644 (file)
@@ -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);
This page took 0.073613 seconds and 5 git commands to generate.