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
Rebase.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
lambda
/
lambda-non-const.C
blob
b5a335eaf13ebbf42bb6734aad7e4f9315ce9ee1
1
// { dg-do run { target c++11 } }
2
3
#include <cassert>
4
5
template<typename F>
6
void call(F f) { f(); }
7
8
int main() {
9
call([] () -> void {});
10
call([] () mutable -> void {});
11
12
int i = -1;
13
call([i] () mutable -> void { i = 0; });
14
assert(i == -1);
15
16
return 0;
17
}
18