]> gcc.gnu.org Git - gcc.git/blob - gcc/testsuite/g++.dg/cpp0x/lambda/lambda-capture-const-ref-neg.C
merge in cxx0x-lambdas-branch@152308
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-capture-const-ref-neg.C
1 // { dg-options "-std=c++0x" }
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
This page took 0.038096 seconds and 5 git commands to generate.