Commit 43a8d6cc by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/56895 (ICE: unexpected expression of kind arrow_expr)

	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.

From-SVN: r197824
parent a2a5f18e
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
......
......@@ -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;
......
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.
......
// 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> ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment