* 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: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197824
138bc75d-0d04-0410-961f-
82ee72b054a4
+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 Jason Merrill <jason@redhat.com>
PR c++/56901
{
/* 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;
+2013-04-11 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/56895
+ * g++.dg/template/arrow4.C: New test.
+
2013-04-11 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/array23.adb: New test.
--- /dev/null
+// PR c++/56895
+// { dg-do compile }
+
+void fn (int *);
+void fn (int);
+extern struct A { bool foo (); A bar (); } *a;
+
+template <int>
+void
+baz ()
+{
+ fn (a->bar().foo() ? 1 : 0);
+}
+
+void
+test ()
+{
+ baz<0> ();
+}