// PR c++/58761 // { dg-do compile { target c++11 } } template struct X { int x = 42; int y = [this](){return this->x;}(); }; template struct Y { int x = 42; int y = [this](){return this->x;}(); Y(int) {} }; int main() { X x; Y y(42); }