diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2011-12-04 01:40:36 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2011-12-04 01:40:36 +0000 |
commit | 5a6bdb0d87ef2876ff38795dfcf9edd1c796af29 (patch) | |
tree | 929367c326e2fc7938b66f3a6e764d6b4965f9df /gcc | |
parent | 9c3a724411cee39a7bca5b159fcd43d1f93d44db (diff) | |
download | gcc-5a6bdb0d87ef2876ff38795dfcf9edd1c796af29.zip gcc-5a6bdb0d87ef2876ff38795dfcf9edd1c796af29.tar.gz gcc-5a6bdb0d87ef2876ff38795dfcf9edd1c796af29.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/call.c | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/pr51313.C | 18 |
4 files changed, 30 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 201f5ef..8f26f23 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 548a36b..93d14be 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c7cfa2c..17e2179 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr51313.C b/gcc/testsuite/g++.dg/cpp0x/pr51313.C new file mode 100644 index 0000000..ff078e0 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr51313.C @@ -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); +} |