aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2008-09-17 19:07:27 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2008-09-17 19:07:27 +0000
commitc74147d2a9aab35e6cc77d4111d3910bd462bd0d (patch)
treee458476dc2087b05037ed2bf2c82df38cc0ced5f /gcc/cp
parent52a764acf76949daf594c2a030fa20c8383946c8 (diff)
downloadgcc-c74147d2a9aab35e6cc77d4111d3910bd462bd0d.zip
gcc-c74147d2a9aab35e6cc77d4111d3910bd462bd0d.tar.gz
gcc-c74147d2a9aab35e6cc77d4111d3910bd462bd0d.tar.bz2
re PR c++/22374 (C++ front-end produces mis-match types in MODIFY_EXPR (dynamic_cast))
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. From-SVN: r140427
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/rtti.c4
2 files changed, 9 insertions, 1 deletions
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 <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 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*. */