This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Using Lambda with variables in deriving class: Regression or not?


Hello,

I don't know if this is already known but in a member function, when I
use any variable of the derived class in a lambda,
I get the following error: capture of non-variable 'Derived::Class::variable'

It used to work with GCC (on version 4.6) but now with 4.7 it doesn't
work anymore.

As a workaround I turned

[&variable]() -> void
{
??? variable->memfunc();
}

to

[&]() -> void
{
??? variable->memfunc();
}


Did I do something wrong or why is this not working anymore?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]