OSDN Git Service

PR c++/52743
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 29 Mar 2012 14:45:09 +0000 (14:45 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 29 Mar 2012 14:45:09 +0000 (14:45 +0000)
* call.c (compare_ics): Handle ck_aggr like ck_list.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@185964 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 6bbdaad..00e89e2 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-29  Jason Merrill  <jason@redhat.com>
+
+       PR c++/52743
+       * call.c (compare_ics): Handle ck_aggr like ck_list.
+
 2012-03-28  Jason Merrill  <jason@redhat.com>
 
        PR c++/52746
index c962ca0..74d5afa 100644 (file)
@@ -7615,7 +7615,7 @@ compare_ics (conversion *ics1, conversion *ics2)
      Specifically, we need to do the reference binding comparison at the
      end of this function.  */
 
-  if (ics1->user_conv_p || ics1->kind == ck_list)
+  if (ics1->user_conv_p || ics1->kind == ck_list || ics1->kind == ck_aggr)
     {
       conversion *t1;
       conversion *t2;
index 368e020..14dfe57 100644 (file)
@@ -1,3 +1,8 @@
+2012-03-29  Jason Merrill  <jason@redhat.com>
+
+       PR c++/52743
+       * g++.dg/cpp0x/initlist-array3.C: New.
+
 2012-03-28  Jason Merrill  <jason@redhat.com>
 
        PR c++/52746
diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-array3.C b/gcc/testsuite/g++.dg/cpp0x/initlist-array3.C
new file mode 100644 (file)
index 0000000..1a94f4e
--- /dev/null
@@ -0,0 +1,10 @@
+// PR c++/52743
+// { dg-do compile { target c++11 } }
+
+void composite (int const (&) [2]);
+void composite (int const (&) [3]);
+
+int main ()
+{
+  composite({0,1});            // { dg-error "ambiguous" }
+}