]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/50901 (ICE: in build_new_op, at cp/call.c:5016)
authorPaolo Carlini <paolo.carlini@oracle.com>
Sun, 30 Oct 2011 00:24:51 +0000 (00:24 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Sun, 30 Oct 2011 00:24:51 +0000 (00:24 +0000)
/cp
2011-10-29  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/50901
* call.c (build_new_op_1): Handle ABS_EXPR together with the
other unary EXPR.

/testsuite
2011-10-29  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/50901
* g++.dg/cpp0x/pr50901.C: New.

From-SVN: r180671

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr50901.C [new file with mode: 0644]

index 36d32c135bea11af28a88688da82bc469e2a8bf9..6262513c4485c26a54d3c570afcef87044a1c478 100644 (file)
@@ -1,3 +1,9 @@
+2011-10-29  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       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.
index c54ce7b65f39d2f322425de4bde16e78c8db76b4..50e5c5aff7b1c7ca7f9d82623807a16683645526 100644 (file)
@@ -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:
index 797c7c054fa3ddb3180d642c6f7ffe5fa43b2d18..2f6d6576a74b52fc95e4406345fa01290689304a 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-29  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/50901
+       * g++.dg/cpp0x/pr50901.C: New.
+
 2011-10-27  Uros Bizjak  <ubizjak@gmail.com>
            Steven G. Kargl  <kargl@gcc.gnu.org>
 
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr50901.C b/gcc/testsuite/g++.dg/cpp0x/pr50901.C
new file mode 100644 (file)
index 0000000..439c15c
--- /dev/null
@@ -0,0 +1,9 @@
+// { dg-options "-std=c++0x" }
+
+template<class T> int foo(int a)
+{
+  const unsigned b = a < 0 ? -a : a;
+  return 0;
+}
+
+int i = foo<float>(1);