Bug 340407

Summary: Bad uses for variables declared in for loop in lambda
Product: [Applications] kdevelop Reporter: Nicolás Alvarez <nalvarez>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version First Reported In: 4.7.0   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Nicolás Alvarez 2014-10-27 17:44:56 UTC
In this code:
void foo() {
    []() {
        for (int num = 0; num < 53; num++) {
            bar(num);
        }
    };
}
the second and third instances of 'num'  in the for statement are highlighted as "declaration not found" errors, and not as uses of the 'int num' declaration. The 'num' in the bar() call is highlighted correctly.

This only occurs if the for loop is inside a lambda body.
Comment 1 Nicolás Alvarez 2014-10-27 17:46:23 UTC
I just found this was already reported...

*** This bug has been marked as a duplicate of bug 329620 ***