diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-13 19:32:42 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-13 19:32:42 +0000 |
commit | a4dde6f12e62315c77c1744e9fee2fd53f734561 (patch) | |
tree | fdb89b360d4f13a418472311ee2954a9b37c39d6 /gcc/cp/call.c | |
parent | 65848528e7c2ba52598a143493fd6f1b591fd9c0 (diff) | |
download | ppe42-gcc-a4dde6f12e62315c77c1744e9fee2fd53f734561.tar.gz ppe42-gcc-a4dde6f12e62315c77c1744e9fee2fd53f734561.zip |
PR c++/56998
* call.c (null_ptr_cst_p): An expression with side-effects can't
be a C++03 null pointer constant.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@198845 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/call.c')
-rw-r--r-- | gcc/cp/call.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/cp/call.c b/gcc/cp/call.c index bd8f531eea4..9f3a50d47d2 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -554,7 +554,7 @@ null_ptr_cst_p (tree t) if (CP_INTEGRAL_TYPE_P (TREE_TYPE (t))) { /* Core issue 903 says only literal 0 is a null pointer constant. */ - if (cxx_dialect < cxx0x) + if (cxx_dialect < cxx0x && !TREE_SIDE_EFFECTS (t)) t = maybe_constant_value (fold_non_dependent_expr_sfinae (t, tf_none)); STRIP_NOPS (t); if (integer_zerop (t) && !TREE_OVERFLOW (t)) |