1 // PR c++/65339
2 // { dg-do compile { target c++11 } }
3 
4 class FuncWrapper {
5 public:
callfunc(Func f)6   template <typename Func> void callfunc(Func f)
7   {
8      f();
9   }
10 };
11 
12 class Object {
13   int field;
14 public:
15   void Method();
Object()16   Object() { field = 555; }
Object(const Object &)17   Object(const Object&) { __builtin_abort(); }
18 };
19 
Method()20 void Object::Method ()
21 {
22   FuncWrapper wrap;
23   wrap.callfunc(*[]()
24 		{
25 		  return Object();
26 		});
27 }
28