OSDN Git Service

2006-06-01 Andrew Pinski <pinskia@physics.uc.edu>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Jun 2006 18:25:40 +0000 (18:25 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 4 Jun 2006 18:25:40 +0000 (18:25 +0000)
        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.

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

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

index e4186b9..0d0c6a5 100644 (file)
@@ -1,5 +1,11 @@
 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
        * typeck.c (build_unary_op): Mark the function as being used.
 
index 6242e44..7a46996 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*.  */