Bug 329620 - Incorrect 'declaration not found' of for-loop variable when inside lambda
Summary: Incorrect 'declaration not found' of for-loop variable when inside lambda
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Language Support: CPP (old) (other bugs)
Version First Reported In: 4.6.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
: 340407 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-01-05 14:35 UTC by Drew Noakes
Modified: 2016-12-13 08:02 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.0.0
Sentry Crash Report:


Attachments
Bug has been resolved (658.79 KB, image/png)
2016-04-22 06:38 UTC, Sumeet Tulsani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Drew Noakes 2014-01-05 14:35:35 UTC
To reproduce, create this function.

void test()
{
  []() {
    {
      for (int n = 0; n < 10; n++)
      {
      }
    }
  };
}

The symbol 'n' is highlighted as being unknown in expressions 'n < 10' and 'n++'.

This does not occur if the loop is moved outside the lambda.
Comment 1 Nicolás Alvarez 2014-10-27 17:46:23 UTC
*** Bug 340407 has been marked as a duplicate of this bug. ***
Comment 2 Sumeet Tulsani 2016-04-22 06:38:14 UTC
Created attachment 98501 [details]
Bug has been resolved

The attached bug has been resolved and does not occur anymore as suggested in the attached file.
Comment 3 Kevin Funk 2016-04-22 07:10:59 UTC
Thanks for the feedback. Very useful.