aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-this6.C
blob: 8c35126e97f1e9a05c97a89154f80597adb969fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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);
}