https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82070
Bug ID: 82070 Summary: [8 Regression] inaccessible within this context in lambda rejects valid Product: gcc Version: 8.0 Status: UNCONFIRMED Keywords: rejects-valid Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: jason at gcc dot gnu.org Target Milestone: --- Starting from r251433 we reject (reduced from Firefox): $ cat pkixcert.ii namespace a { template <typename b> void c (int, int, b d) { [d] { [d] {}; }; } } void e () { int f; a::c (f, 3, [] {}); } $ g++ pkixcert.ii -c -std=gnu++11 pkixcert.ii: In instantiation of ‘void a::c(int, int, b) [with b = e()::<lambda()>]’: pkixcert.ii:13:20: required from here pkixcert.ii:6:5: error: ‘e()::<lambda()> a::c(int, int, b) [with b = e()::<lambda()>]::__lambda0::<d capture>’ is inaccessible within this context [d] { [d] {}; }; ^ pkixcert.ii:6:4: note: declared here [d] { [d] {}; }; ^ pkixcert.ii:6:5: error: invalid use of nonstatic data member ‘a::c(int, int, b) [with b = e()::<lambda()>]::__lambda0::<d capture>’ [d] { [d] {}; }; ^