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
2017-09-13 Paolo Carlini <paolo.carlini@oracle.com>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
lambda
/
lambda-capture-const-ref-neg.C
blob
9c9632cd5165d32d4931beca024cd09ea009761f
1
// { dg-do compile { target c++11 } }
2
#include <cassert>
3
4
int main() {
5
int i = 1, j = 2;
6
const int& ci = i;
7
[&ci, &j] () -> void { j = ci; } ();
8
assert(i == 1);
9
assert(j == 1);
10
[&ci] () -> void { ci = 0; } (); // { dg-error "" "cannot assign to const int&" }
11
12
return 0;
13
}
14