From 0f4d5c1c4d6c91c3cad04c484c5dac2324e94a82 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 28 Oct 1999 23:55:28 +0000 Subject: [PATCH] rtti.c (build_dynamic_cast_1): Give a better error message for an attempt to dynamic_cast a polymorphic type. * rtti.c (build_dynamic_cast_1): Give a better error message for an attempt to dynamic_cast a polymorphic type. From-SVN: r30248 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/rtti.c | 3 +++ 2 files changed, 8 insertions(+) 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);