blob: 19adb7e612939bf69a839a15de90ac4ab3918164 [file] [log] [blame]
// PR c++/80831
// { dg-options -fsyntax-only }
// { dg-do compile { target c++11 } }
class A
{
public:
virtual ~A() { }
};
class B { };
class C : public A { };
template<class J>
class D : public C
{
public:
D() { }
~D() { }
};
class E
{
public:
static E& p();
B q();
template<class J>
B q(void (J::*r)())
{
new D<J>();
return q();
}
};
void t()
{
class F
{
public:
virtual void s() { }
};
E& x = E::p();
B y = x.q(&F::s);
}