diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/rtti.c | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 502c6506ce0..ebab140a9f5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-09-17 Richard Guenther <rguenther@suse.de> + + PR c++/22374 + * rtti.c (build_dynamic_cast_1): Convert the COND_EXPR + result to the correct type. + 2008-09-17 H.J. Lu <hongjiu.lu@intel.com> PR c++/37450 diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index e3e5349f5ca..1c67832a7fd 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*. */ |