aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this.C
blob: b32f8d7cc28e18a3afb3ea499c19edbbd022376c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Test that implicit 'this' capture works, but that it's still an rvalue.
// { dg-do compile { target c++11 } }

struct A
{
  int i;
  void f()
  {
    [=] { i = 0; };
    [&] { i = 0; };
    [=] { this = 0; };		// { dg-error "lvalue" }
  }
};