OSDN Git Service

2008-09-17 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Sep 2008 19:07:27 +0000 (19:07 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 17 Sep 2008 19:07:27 +0000 (19:07 +0000)
PR c++/22374
* rtti.c (build_dynamic_cast_1): Convert the COND_EXPR
result to the correct type.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140427 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/rtti.c

index 502c650..ebab140 100644 (file)
@@ -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
index e3e5349..1c67832 100644 (file)
@@ -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*.  */