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
/
cpp1y
/
lambda-init14.C
blob
f7fffc5127dda2f91783e065a0f71ba845b339a0
1
// PR c++/69392
2
// { dg-do compile { target c++14 } }
3
4
template <typename T>
5
class Foo {
6
public:
7
void foo(void) {}
8
auto getCallableFoo(void) {
9
return
10
[ptr = this]() { ptr->foo(); };
11
}
12
};
13
14
int main()
15
{
16
Foo<int> f;
17
auto callable = f.getCallableFoo();
18
callable();
19
}