diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6fb431945ee..2b01e90c4fb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1999-10-28 Ian Lance Taylor + + * 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 * cp-tree.h (make_temp_vec): Remove. diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 2580eaa63a6..78c1059e6a3 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -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);