* rtti.c (build_dynamic_cast_1): Give a better error message for
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Oct 1999 23:55:28 +0000 (23:55 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 28 Oct 1999 23:55:28 +0000 (23:55 +0000)
an attempt to dynamic_cast a polymorphic type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@30248 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/rtti.c

index 6fb4319..2b01e90 100644 (file)
@@ -1,3 +1,8 @@
+1999-10-28  Ian Lance Taylor  <ian@zembu.com>
+
+       * rtti.c (build_dynamic_cast_1): Give a better error message for
+       an attempt to dynamic_cast a polymorphic type.
+
 1999-10-27  Mark Mitchell  <mark@codesourcery.com>
 
        * cp-tree.h (make_temp_vec): Remove.
index 2580eaa..78c1059 100644 (file)
@@ -692,6 +692,9 @@ build_dynamic_cast_1 (type, expr)
        }
     }
 
+  cp_error ("dynamic_cast from non-polymorphic type `%#T'", exprtype);
+  return error_mark_node;
+
  fail:
   cp_error ("cannot dynamic_cast `%E' (of type `%#T') to type `%#T'",
            expr, exprtype, type);