diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nsdmi6.C')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nsdmi6.C | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nsdmi6.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nsdmi6.C new file mode 100644 index 0000000000..98cdbce28b --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-nsdmi6.C @@ -0,0 +1,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); +} |