* call.c (joust): Handle comparing list and non-list ctors.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186433
138bc75d-0d04-0410-961f-
82ee72b054a4
2012-04-13 Jason Merrill <jason@redhat.com>
+ PR c++/52905
+ * call.c (joust): Handle comparing list and non-list ctors.
+
PR c++/52915
* decl2.c (finish_anon_union): Use cp_finish_decl.
* error.c (dump_function_name): Avoid showing anonymous "name".
int static_1 = DECL_STATIC_FUNCTION_P (cand1->fn);
int static_2 = DECL_STATIC_FUNCTION_P (cand2->fn);
+ if (DECL_CONSTRUCTOR_P (cand1->fn)
+ && is_list_ctor (cand1->fn) != is_list_ctor (cand2->fn))
+ /* We're comparing a near-match list constructor and a near-match
+ non-list constructor. Just treat them as unordered. */
+ return 0;
+
gcc_assert (static_1 != static_2);
if (static_1)
2012-04-13 Jason Merrill <jason@redhat.com>
+ PR c++/52905
+ * g++.dg/cpp0x/initlist-ctor1.C: New.
+
PR c++/52915
* g++.dg/other/anon-union2.C: New.
--- /dev/null
+// PR c++/52905
+// { dg-options -std=c++11 }
+
+#include <initializer_list>
+
+enum E { e1, e2 };
+struct A
+{
+ A(std::initializer_list<E>); // { dg-message "A::A" }
+ A(int, E); // { dg-message "A::A" }
+};
+
+A a{e1,2}; // { dg-error "" }