http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59483
Bug ID: 59483 Summary: A nested lambda fails to find a protected name with qualified name Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ville.voutilainen at gmail dot com Test: struct X { protected: int i; }; struct Y: X { void f() { [&]{ X::i = 3; }(); } // #1 }; Output: eelis.cpp: In lambda function: eelis.cpp:3:7: error: ‘int X::i’ is protected int i; ^ eelis.cpp:8:13: error: within this context [&]{ X::i = 3; }(); } ^ Removing X:: from #1 makes it work. Clang 3.4 accepts the code either with X:: or without it.