From 8099ed26b53e63735aee8bb633b68de182aa5600 Mon Sep 17 00:00:00 2001 From: paolo Date: Sun, 30 Oct 2011 00:22:53 +0000 Subject: [PATCH] /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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180670 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/call.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/pr50901.C | 9 +++++++++ 4 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr50901.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index b25d362..64c932d 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 7e87bdf..439a1fe 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 598063e..d02c4bd 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 0000000..439c15c --- /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); -- 2.7.4