diff options
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this6.C')
-rw-r--r-- | gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this6.C | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this6.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this6.C new file mode 100644 index 000000000..8c35126e9 --- /dev/null +++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this6.C @@ -0,0 +1,32 @@ +// PR c++/53137 +// { dg-do compile { target c++11 } } + +template <typename STORE> +void getParent(STORE& tStore) +{ +} + +struct Store +{ + template <typename CheckParentFunc> + void updateChildCommon(CheckParentFunc c) + { + c(); + } + + template <typename T> + int& getStore(); + + template <typename T> + void updateChild(const T& obj) + { + updateChildCommon([this] () { getParent(getStore<T>()); }); + } + + void update(int obj); +}; + +void Store::update(int obj) +{ + updateChild(obj); +} |