8sa1-gcc/gcc/testsuite/g++.dg/cpp0x/nullptr40.C
Marek Polacek ab97c3cdaf 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.

	* g++.dg/cpp0x/nullptr40.C: New test.
	* g++.dg/cpp0x/nullptr41.C: New test.

From-SVN: r268781
2019-02-11 20:03:43 +00:00

20 lines
350 B
C

// 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;
};