re PR c++/51313 ([C++0x] ICE: tree check: expected class 'constant', have 'unary' (nop_expr) in null_ptr_cst_p, at cp/call.c:556)

/cp
2011-12-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51313
	* call.c (null_ptr_cst_p): STRIP_NOPS in c++11 mode too.

/testsuite
2011-12-03  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/51313
	* g++.dg/cpp0x/pr51313.C: New.

From-SVN: r181980
This commit is contained in:
Paolo Carlini 2011-12-04 01:40:36 +00:00 committed by Paolo Carlini
parent 9c3a724411
commit 5a6bdb0d87
4 changed files with 30 additions and 4 deletions

View file

@ -1,3 +1,8 @@
2011-12-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51313
* call.c (null_ptr_cst_p): STRIP_NOPS in c++11 mode too.
2011-12-01 Jason Merrill <jason@redhat.com>
* call.c (build_new_method_call_1): Handle aggregate initialization.

View file

@ -549,10 +549,8 @@ null_ptr_cst_p (tree t)
{
/* Core issue 903 says only literal 0 is a null pointer constant. */
if (cxx_dialect < cxx0x)
{
t = integral_constant_value (t);
STRIP_NOPS (t);
}
t = integral_constant_value (t);
STRIP_NOPS (t);
if (integer_zerop (t) && !TREE_OVERFLOW (t))
return true;
}

View file

@ -1,3 +1,8 @@
2011-12-03 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/51313
* g++.dg/cpp0x/pr51313.C: New.
2011-12-03 Tobias Burnus <burnus@net-b.de>
PR fortran/48887

View file

@ -0,0 +1,18 @@
// PR c++/51313
// { dg-options "-std=c++0x" }
class ostream;
extern "C" {
extern int isdigit (int);
}
ostream&
operator<<(ostream&, const unsigned char*);
extern ostream cout;
int main()
{
cout << isdigit(0);
}