From: Paolo Carlini Date: Sun, 30 Oct 2011 00:22:53 +0000 (+0000) Subject: re PR c++/50901 (ICE: in build_new_op, at cp/call.c:5016) X-Git-Tag: releases/gcc-4.7.0~2708 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6908120ace0a02c62d99ad74e5f9053b3f6b8c41;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: r180670 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b25d362f1ba1..64c932d646c6 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-28 Paolo Carlini Revert: diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 7e87bdfea026..439a1fe7c4f3 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5223,6 +5223,7 @@ build_new_op_1 (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 598063e56a78..d02c4bd30a33 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-29 Uros Bizjak * gcc.target/i386/fma-check.h (main): Use return 0 instead of exit (0). 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);