Bug 329620

Summary: Incorrect 'declaration not found' of for-loop variable when inside lambda
Product: [Applications] kdevelop Reporter: Drew Noakes <kde>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: nalvarez, sumeettulsani1
Priority: NOR    
Version First Reported In: 4.6.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.0.0
Sentry Crash Report:
Attachments: Bug has been resolved

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.