+2016-05-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/70466
+ * call.c (convert_like_real): Check that we are actually converting
+ from an init list.
+
2016-05-16 Matthew Wahab <matthew.wahab@arm.com>
* decl.c (grokdeclarator): Remove errmsg and use of
/* When converting from an init list we consider explicit
constructors, but actually trying to call one is an error. */
if (DECL_NONCONVERTING_P (convfn) && DECL_CONSTRUCTOR_P (convfn)
+ && BRACE_ENCLOSED_INITIALIZER_P (expr)
/* Unless this is for direct-list-initialization. */
- && !DIRECT_LIST_INIT_P (expr)
+ && !CONSTRUCTOR_IS_DIRECT_INIT (expr)
/* And in C++98 a default constructor can't be explicit. */
&& cxx_dialect >= cxx11)
{
+2016-05-18 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/70466
+ * g++.dg/template/pr70466-1.C: New.
+ * g++.dg/template/pr70466-2.C: Likewise.
+
2016-05-18 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/p9-splat-1.c: New tests for ISA 3.0 word
--- /dev/null
+// PR c++/70466
+
+template < class T, class T > // { dg-error "conflicting" }
+class A
+{
+public:
+ explicit A (T (S::*f) ()) {} // { dg-error "expected" }
+};
+
+template < class T, class S >
+A < T, S > foo (T (S::*f) ())
+{
+ return A < T, S > (f);
+}
+
+class B
+{
+public:
+ void bar () {}
+};
+
+int
+main ()
+{
+ foo (&B::bar);
+ return 0;
+}
--- /dev/null
+// PR c++/70466
+
+template < class T, class S >
+struct A
+{
+ explicit A (...) {}
+};
+
+template < class T, class S >
+A < T, S > foo (T (S::*f) ())
+{
+ return A < T, S > (f);
+}
+
+struct B
+{
+ void bar () {}
+};
+
+int
+main ()
+{
+ foo (&B::bar);
+ return 0;
+}