mirror of git://gcc.gnu.org/git/gcc.git
28 lines
386 B
C
28 lines
386 B
C
// PR c++/65339
|
|
// { dg-do compile { target c++11 } }
|
|
|
|
class FuncWrapper {
|
|
public:
|
|
template <typename Func> void callfunc(Func f)
|
|
{
|
|
f();
|
|
}
|
|
};
|
|
|
|
class Object {
|
|
int field;
|
|
public:
|
|
void Method();
|
|
Object() { field = 555; }
|
|
Object(const Object&) { __builtin_abort(); }
|
|
};
|
|
|
|
void Object::Method ()
|
|
{
|
|
FuncWrapper wrap;
|
|
wrap.callfunc(*[]()
|
|
{
|
|
return Object();
|
|
});
|
|
}
|