summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-06 16:47:40 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-06 16:47:40 +0000
commitea9557c6c9cdc849864f0abc25e20b2a0e49e8dc (patch)
treefd7a3c08d7f0205a9ddb7c18a52a076dcc41e6f4 /gcc/cp
parent3f4feb44c143eefd987a2c0dffb10c7be75c691a (diff)
downloadgcc-ea9557c6c9cdc849864f0abc25e20b2a0e49e8dc.tar.gz
* call.c (null_ptr_cst_p): Add explicit TREE_CONSTANT_OVERFLOW check.
* g++.dg/conversion/nullptr1.C: New test case. * g++.dg/conversion/nullptr2.C: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112734 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/call.c4
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 96191a2bb7f..266e3476260 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,7 @@
+2006-04-06 Roger Sayle <roger@eyesopen.com>
+
+ * call.c (null_ptr_cst_p): Add explicit TREE_CONSTANT_OVERFLOW check.
+
2006-04-05 Jason Merrill <jason@redhat.com>
* name-lookup.c (push_namespace_with_attribs): Temporarily disable
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 268573d5bc0..0413a9885dd 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -427,7 +427,9 @@ null_ptr_cst_p (tree t)
(_expr.const_) rvalue of integer type that evaluates to zero. */
t = integral_constant_value (t);
if (t == null_node
- || (CP_INTEGRAL_TYPE_P (TREE_TYPE (t)) && integer_zerop (t)))
+ || (CP_INTEGRAL_TYPE_P (TREE_TYPE (t))
+ && integer_zerop (t)
+ && !TREE_CONSTANT_OVERFLOW (t)))
return true;
return false;
}