re PR c++/59483 (A nested lambda fails to find a protected name with qualified name)
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / lambda / lambda-61148.C
1 // PR c++/61148
2 // { dg-do compile { target c++11 } }
3
4 class DB
5 {
6 protected:
7 void foo() {};
8 };
9
10 class DC : public DB
11 {
12 public:
13 DC()
14 {
15 [this]() {DB::foo();}();
16 };
17 };
18
19 template <class T>
20 class DC2 : public T
21 {
22 public:
23 DC2()
24 {
25 [this]() {T::foo();}();
26 };
27 };
28
29 int main(void)
30 {
31 DC x;
32 DC2<DB> x2;
33 }