diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2006-06-04 18:25:40 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2006-06-04 11:25:40 -0700 |
commit | a0c04f8e495477e0bf1c0d8d87f1a32985003533 (patch) | |
tree | 5781500cb6bd289e2dd99351f9d40eee47428885 /gcc | |
parent | 5c147e22785838d1cf042c074a28297c07476105 (diff) | |
download | gcc-a0c04f8e495477e0bf1c0d8d87f1a32985003533.zip gcc-a0c04f8e495477e0bf1c0d8d87f1a32985003533.tar.gz gcc-a0c04f8e495477e0bf1c0d8d87f1a32985003533.tar.bz2 |
re PR c++/27592 (dynamic cast failure)
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
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 e4186b9..0d0c6a5 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 6242e44..7a46996 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -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*. */ |