+2019-02-11 Marek Polacek <polacek@redhat.com>
+
+ PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
+ * pt.c (tsubst_copy_and_build) <case CONSTRUCTOR>: Return early for
+ null member pointer value.
+
2019-02-11 Jakub Jelinek <jakub@redhat.com>
PR c++/88977
looked up by digest_init. */
process_index_p = !(type && MAYBE_CLASS_TYPE_P (type));
+ if (null_member_pointer_value_p (t))
+ {
+ gcc_assert (same_type_p (type, TREE_TYPE (t)));
+ RETURN (t);
+ }
+
n = vec_safe_copy (CONSTRUCTOR_ELTS (t));
newlen = vec_safe_length (n);
FOR_EACH_VEC_SAFE_ELT (n, idx, ce)
+2019-02-11 Marek Polacek <polacek@redhat.com>
+
+ PR c++/89212 - ICE converting nullptr to pointer-to-member-function.
+ * g++.dg/cpp0x/nullptr40.C: New test.
+ * g++.dg/cpp0x/nullptr41.C: New test.
+
2019-02-11 Jakub Jelinek <jakub@redhat.com>
PR c++/88977
--- /dev/null
+// PR c++/89212
+// { dg-do compile { target c++11 } }
+
+template <int, typename T> using enable_if_t = int;
+
+template<class X, void(X::*foo)() = nullptr>
+struct p
+{
+ template<void(X::*fun)() = foo, typename T = enable_if_t<nullptr == fun, int>>
+ p(T) { }
+ p() = default;
+};
+
+struct A
+{
+ p<A> i = 1;
+ void bar();
+ p<A, &A::bar> j;
+};
--- /dev/null
+// PR c++/89212
+// { dg-do compile { target c++11 } }
+
+template <int, typename T> using enable_if_t = int;
+
+template<typename U, typename W, typename Y, class X, W(X::*foo)() = nullptr>
+struct p
+{
+ template<U(Y::*fun)() = foo, typename T = enable_if_t<nullptr == fun, int>>
+ p(T) { }
+ p() = default;
+};
+
+struct A
+{
+ p<void, void, A, A> i = 1;
+ void bar();
+ p<void, void, A, A, &A::bar> j;
+};