Bug 373065

Summary: Range-based for-loop doesn't have uses on the container side
Product: [Applications] kdevelop Reporter: Nicolás Alvarez <nalvarez>
Component: Language Support: CPP (Clang-based)Assignee: kdevelop-bugs-null
Status: RESOLVED UPSTREAM    
Severity: normal    
Priority: NOR    
Version First Reported In: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Nicolás Alvarez 2016-11-29 05:46:34 UTC
When using a range-based for-loop, there is a correct declaration for the element variable, but there are no uses for the range passed to the loop; it's not highlighted at all in the editor.

void test() {
    std::vector<int> myVector = {1,2,3,4,5};
    for (int x : myVector) { // myVector is shown in black with no tooltip
        x+=1;
    }
}
Comment 1 Kevin Funk 2016-11-29 08:34:47 UTC
Works fine for me as well.

Using an (even relatively old) Clang version 3.8.1-12ubuntu1.

What's your Clang version?
Comment 2 Nicolás Alvarez 2016-11-30 02:23:16 UTC
I was using clang 3.5. Using 3.8.1 indeed fixes this.