]> gcc.gnu.org Git - gcc.git/commitdiff
re PR c++/27592 (dynamic cast failure)
authorAndrew Pinski <pinskia@physics.uc.edu>
Sun, 4 Jun 2006 18:25:40 +0000 (18:25 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Sun, 4 Jun 2006 18:25:40 +0000 (11:25 -0700)
2006-06-01  Andrew Pinski  <pinskia@physics.uc.edu>

        PR c++/27592
        * rtti.c (build_dynamic_cast_1): Call c_common_truthvalue_conversion
        on operand of the COND_EXPR for the null pointer check.

From-SVN: r114361

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

index e4186b9d86405d06701ba44824249270c5bef198..0d0c6a59b89ee3464b98f50290d77808357c84b5 100644 (file)
@@ -1,3 +1,9 @@
+2006-06-01  Andrew Pinski  <pinskia@physics.uc.edu>
+
+       PR c++/27592
+       * rtti.c (build_dynamic_cast_1): Call c_common_truthvalue_conversion
+       on operand of the COND_EXPR for the null pointer check.
+
 2006-06-01  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR c++/26740
index 6242e44c3e944cfc37f55b02c081a55e6a9c807c..7a46996713218f318e4cfb8cb22040cb3c906623 100644 (file)
@@ -677,9 +677,11 @@ build_dynamic_cast_1 (tree type, tree expr)
          if (tc == REFERENCE_TYPE)
            {
              tree bad = throw_bad_cast ();
+             tree neq;
 
              result = save_expr (result);
-             return build3 (COND_EXPR, type, result, result, bad);
+             neq = c_common_truthvalue_conversion (result);
+             return build3 (COND_EXPR, type, neq, result, bad);
            }
 
          /* Now back to the type we want from a void*.  */
This page took 0.063267 seconds and 5 git commands to generate.