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
Reset branch to trunk.
[official-gcc.git]
/
trunk
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
lambda
/
lambda-capture-const-ref.C
blob
f9cb2d53de28d43c08e933c442e9a9ff867c83ff
1
// { dg-do "run" }
2
// { dg-options "-std=c++0x" }
3
#include <cassert>
4
5
int main() {
6
int i = 1, j = 2;
7
const int& ci = i;
8
[&ci, &j] () -> void { j = ci; } ();
9
assert(i == 1);
10
assert(j == 1);
11
//[&ci] () -> void { ci = 0; } (); { dg-error: cannot assign to const int& }
12
13
return 0;
14
}
15