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
2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1z
/
constexpr-lambda18.C
blob
c7ef8d0752e8ef3553b5c44050dc9bf3702bcb51
1
// PR c++/82570
2
// { dg-do compile { target c++17 } }
3
4
template< typename Body >
5
inline void iterate(Body body)
6
{
7
body(10);
8
}
9
10
template< typename Pred >
11
inline void foo(Pred pred)
12
{
13
iterate([&](int param)
14
{
15
if (pred(param))
16
{
17
unsigned char buf[4];
18
buf[0] = 0;
19
buf[1] = 1;
20
buf[2] = 2;
21
buf[3] = 3;
22
}
23
});
24
}
25
26
int main()
27
{
28
foo([](int x) { return x > 0; });
29
return 0;
30
}