From c74147d2a9aab35e6cc77d4111d3910bd462bd0d Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Wed, 17 Sep 2008 19:07:27 +0000 Subject: re PR c++/22374 (C++ front-end produces mis-match types in MODIFY_EXPR (dynamic_cast)) 2008-09-17 Richard Guenther PR c++/22374 * rtti.c (build_dynamic_cast_1): Convert the COND_EXPR result to the correct type. From-SVN: r140427 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/rtti.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 502c650..ebab140 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-09-17 Richard Guenther + + PR c++/22374 + * rtti.c (build_dynamic_cast_1): Convert the COND_EXPR + result to the correct type. + 2008-09-17 H.J. Lu PR c++/37450 diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index e3e5349..1c67832 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -722,7 +722,9 @@ build_dynamic_cast_1 (tree type, tree expr, tsubst_flags_t complain) result = save_expr (result); neq = c_common_truthvalue_conversion (result); - return build3 (COND_EXPR, type, neq, result, bad); + return cp_convert (type, + build3 (COND_EXPR, TREE_TYPE (result), + neq, result, bad)); } /* Now back to the type we want from a void*. */ -- cgit v1.1