re PR c++/48162 (447.dealII in SPEC CPU 2006 failed to build)
authorJason Merrill <jason@redhat.com>
Fri, 18 Mar 2011 15:07:13 +0000 (11:07 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Fri, 18 Mar 2011 15:07:13 +0000 (11:07 -0400)
PR c++/48162
* semantics.c (finish_call_expr): Allow TARGET_EXPR for now.

From-SVN: r171148

gcc/cp/ChangeLog
gcc/cp/semantics.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/fn-ptr1.C [new file with mode: 0644]

index 9578f1abf3660d7a472b0cd0519873d627c64563..e187dee223033ba993e8e99041410667a3dac845 100644 (file)
@@ -1,5 +1,8 @@
 2011-03-18  Jason Merrill  <jason@redhat.com>
 
+       PR c++/48162
+       * semantics.c (finish_call_expr): Allow TARGET_EXPR for now.
+
        PR c++/48118
        * call.c (build_over_call): Don't skip ck_rvalue.
 
index b6d1008b490dce728fa2a31427a3e247d14bbdaa..41ab8589dad8c64650b32b268cffe3916beaa56d 100644 (file)
@@ -2155,6 +2155,9 @@ finish_call_expr (tree fn, VEC(tree,gc) **args, bool disallow_virtual,
       if (TREE_CODE (result) == INDIRECT_REF)
        result = TREE_OPERAND (result, 0);
       gcc_assert (TREE_CODE (result) == CALL_EXPR
+                 /* FIXME cp_build_function_call_vec should avoid argument
+                    and return transformations like build_over_call does.  */
+                 || TREE_CODE (result) == TARGET_EXPR
                  || TREE_CODE (fn) == PSEUDO_DTOR_EXPR
                  || errorcount);
       result = build_call_vec (TREE_TYPE (result), orig_fn, orig_args);
index b0f4f53566d793ed437c4068dda06f81517a7eae..c362faf5333450e0641198a32ab5db5625523446 100644 (file)
@@ -1,5 +1,7 @@
 2011-03-18  Jason Merrill  <jason@redhat.com>
 
+       * g++.dg/template/fn-ptr1.C: New.
+
        * g++.dg/overload/volatile1.C: New.
 
        * g++.dg/opt/pr23372.C: New.
diff --git a/gcc/testsuite/g++.dg/template/fn-ptr1.C b/gcc/testsuite/g++.dg/template/fn-ptr1.C
new file mode 100644 (file)
index 0000000..c0e7d98
--- /dev/null
@@ -0,0 +1,5 @@
+// PR c++/48162
+
+struct A { };
+A (*f)();
+template <class T> void g() { f(); }