(root)/
gcc-13.2.0/
gcc/
testsuite/
g++.dg/
cpp0x/
lambda/
lambda-this21.C
// 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" }
    }
};