summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-non-const.C
blob: b6489de4b4486d3df067b6e0374a40f96ab52fcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// { dg-do run }
// { dg-options "-std=c++0x" }

#include <cassert>

template<typename F>
void call(F f) { f(); }

int main() {
  call([] () -> void {});
  call([] () mutable -> void {});

  int i = -1;
  call([i] () mutable -> void { i = 0; });
  assert(i == -1);

  return 0;
}