summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this21.C
blob: 538dd375362b42b00b63134827a4b02f75e9cbba (plain)
1
2
3
4
5
6
7
8
9
10
// PR c++/66999 - 'this' captured by reference.
// { dg-do compile { target c++11 } }

struct X {
  void bar (int n)
    {
      auto l1 = [&this] { }; // { dg-error ".this. cannot be captured by reference" }
      auto l2 = [=, &this] { }; // { dg-error ".this. cannot be captured by reference" }
    }
};