From: Paolo Carlini Date: Sun, 30 Oct 2011 00:24:51 +0000 (+0000) Subject: re PR c++/50901 (ICE: in build_new_op, at cp/call.c:5016) X-Git-Tag: releases/gcc-4.6.3~375 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92d79c51b1debabeb940a207150b8a3b74a210d5;p=thirdparty%2Fgcc.git re PR c++/50901 (ICE: in build_new_op, at cp/call.c:5016) /cp 2011-10-29 Paolo Carlini PR c++/50901 * call.c (build_new_op_1): Handle ABS_EXPR together with the other unary EXPR. /testsuite 2011-10-29 Paolo Carlini PR c++/50901 * g++.dg/cpp0x/pr50901.C: New. From-SVN: r180671 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 36d32c135bea..6262513c4485 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2011-10-29 Paolo Carlini + + PR c++/50901 + * call.c (build_new_op_1): Handle ABS_EXPR together with the + other unary EXPR. + 2011-10-26 Release Manager * GCC 4.6.2 released. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index c54ce7b65f39..50e5c5aff7b1 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -4996,6 +4996,7 @@ build_new_op (enum tree_code code, int flags, tree arg1, tree arg2, tree arg3, case POSTDECREMENT_EXPR: case REALPART_EXPR: case IMAGPART_EXPR: + case ABS_EXPR: return cp_build_unary_op (code, arg1, candidates != 0, complain); case ARRAY_REF: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 797c7c054fa3..2f6d6576a74b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2011-10-29 Paolo Carlini + + PR c++/50901 + * g++.dg/cpp0x/pr50901.C: New. + 2011-10-27 Uros Bizjak Steven G. Kargl diff --git a/gcc/testsuite/g++.dg/cpp0x/pr50901.C b/gcc/testsuite/g++.dg/cpp0x/pr50901.C new file mode 100644 index 000000000000..439c15cc1cd7 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr50901.C @@ -0,0 +1,9 @@ +// { dg-options "-std=c++0x" } + +template int foo(int a) +{ + const unsigned b = a < 0 ? -a : a; + return 0; +} + +int i = foo(1);