OSDN Git Service

PR c++/48118
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Mar 2011 15:07:04 +0000 (15:07 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 18 Mar 2011 15:07:04 +0000 (15:07 +0000)
* call.c (build_over_call): Don't skip ck_rvalue.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171147 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 51535f5..9578f1a 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-18  Jason Merrill  <jason@redhat.com>
+
+       PR c++/48118
+       * call.c (build_over_call): Don't skip ck_rvalue.
+
 2011-03-17  Jason Merrill  <jason@redhat.com>
 
        PR c++/47504
index d040ec8..93383c6 100644 (file)
@@ -6168,12 +6168,6 @@ build_over_call (struct z_candidate *cand, int flags, tsubst_flags_t complain)
 
       conv = convs[i];
 
-      /* Don't make a copy here if build_call is going to.  */
-      if (conv->kind == ck_rvalue
-         && COMPLETE_TYPE_P (complete_type (type))
-         && !TREE_ADDRESSABLE (type))
-       conv = conv->u.next;
-
       /* Warn about initializer_list deduction that isn't currently in the
         working draft.  */
       if (cxx_dialect > cxx98
index b9c7dd8..b0f4f53 100644 (file)
@@ -1,5 +1,7 @@
 2011-03-18  Jason Merrill  <jason@redhat.com>
 
+       * g++.dg/overload/volatile1.C: New.
+
        * g++.dg/opt/pr23372.C: New.
 
        * g++.dg/ext/attrib32.C: Expect errors on the two-names case.
diff --git a/gcc/testsuite/g++.dg/overload/volatile1.C b/gcc/testsuite/g++.dg/overload/volatile1.C
new file mode 100644 (file)
index 0000000..baf467d
--- /dev/null
@@ -0,0 +1,14 @@
+// PR c++/48118
+// { dg-prune-output "note" }
+
+struct A { };
+
+void f (A);                    // { dg-error "argument 1" }
+void (*g)(A);
+
+int main()
+{
+  volatile A a;
+  f(a);                                // { dg-error "no match" }
+  g(a);                                // { dg-error "no match" }
+}