Reset branch to trunk.
[official-gcc.git] / trunk / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-capture-const-ref.C
blobf9cb2d53de28d43c08e933c442e9a9ff867c83ff
1 // { dg-do "run" }
2 // { dg-options "-std=c++0x" }
3 #include <cassert>
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& }
13   return 0;