This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Lambdas without any captures or with automatic capture lists ([] or [&]). Lambdas with a single captured variable also work. However lambdas with multiple captured variables fail to parse. Examples: int x, y, z; // this works fine auto lambda1 = [](int a, int b)->std::string { return std::to_string(a) + " " + std::to_string(b); }; // also works auto lambda2 = [&](int a, int b)->std::string { return std::to_string(a) + " " + std::to_string(b); }; // also works auto lambda2 = [x](int a, int b)->std::string { int c = a + x; return std::to_string(a) + " " + std::to_string(b); }; // does not work // unable to resolve identifier a // unable to resolve identifier b // unable to resolve identifier std auto lambda2 = [x, y, z](int a, int b)->std::string { // unable to resolve identifier c int c = a + x + y + z; return std::to_string(a) + " " + std::to_string(b); }; This has been the case since Version 8.0 and still fails on today's dev build (5/20/15). I have my project set to c++11. Note that code like this worked in version 7.4.
Fixed in http://hg.netbeans.org/cnd-main/rev/47bca6a634a1
Integrated into 'main-silver', will be available in build *201505300811* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/47bca6a634a1 User: Petr Kudryavtsev <petrk@netbeans.org> Log: Fixed #252513 - Broken parsing for lambdas with explicit capture list
Kudos, petrk. Works like a charm now.