aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2013-04-11 19:43:58 +0000
committerJakub Jelinek <jakub@redhat.com>2013-04-11 19:43:58 +0000
commitf74db2b69de5f4855a839236b498bd285b76c9fe (patch)
tree57aeef0ce99c3b151bad20c69744ea055360eca3 /gcc/cp
parent15ef7aec197b1df6e70644b82b6bb39d35874405 (diff)
PR c++/56895
* call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before calling maybe_constant_value for C++98. * g++.dg/template/arrow4.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_8-branch@197825 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 78aeeba646a..aa856ed7eae 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2013-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/56895
+ * call.c (null_ptr_cst_p): Call fold_non_dependent_expr_sfinae before
+ calling maybe_constant_value for C++98.
+
2013-04-11 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/56913
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 65ac3bcc8cc..f575daedb08 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -555,7 +555,7 @@ null_ptr_cst_p (tree t)
{
/* Core issue 903 says only literal 0 is a null pointer constant. */
if (cxx_dialect < cxx0x)
- t = maybe_constant_value (t);
+ t = maybe_constant_value (fold_non_dependent_expr_sfinae (t, tf_none));
STRIP_NOPS (t);
if (integer_zerop (t) && !TREE_OVERFLOW (t))
return true;