repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR c++/56973, DR 696 - capture constant variables only as needed.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
lambda
/
lambda-conv9.C
blob
d7955fd40c607e24b9f686975924a56e136ad754
1
// PR c++/65339
2
// { dg-do compile { target c++11 } }
3
4
class FuncWrapper {
5
public:
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();
16
Object() { field = 555; }
17
Object(const Object&) { __builtin_abort(); }
18
};
19
20
void Object::Method ()
21
{
22
FuncWrapper wrap;
23
wrap.callfunc(*[]()
24
{
25
return Object();
26
});
27
}