summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nsdmi6.C
blob: 98cdbce28b3ea7209a8c8f867976e653be6d51da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// PR c++/58761
// { dg-do compile { target c++11 } }

template <class T>
struct X
{
  int x = 42;
  int y = [this](){return this->x;}();
};

template <class T>
struct Y
{
  int x = 42;
  int y = [this](){return this->x;}();
  Y(int) {}
};

int main()
{
  X<int> x;
  Y<int> y(42);
}