Bug 324388

Summary: No autocompletion on std::vector<T>::operator[] with C++11 STL
Product: [Applications] kdevelop Reporter: Maciej Cencora <m.cencora>
Component: Language Support: CPP (old)Assignee: kdevelop-bugs-null
Status: RESOLVED FIXED    
Severity: normal CC: intelfx, mwoehlke.floss
Priority: NOR    
Version: git master   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:

Description Maciej Cencora 2013-09-02 10:39:13 UTC
For given piece of code:
#include <vector>

int main()
{
    std::vector<std::pair<int, int>> a(2);
    a[1].first = 1;
}

KDevelop does not recognize the ".first" expression

Reproducible: Always

Steps to Reproduce:
1. Open a file with the code above in system with C++11 compliant STL.
2. Hover over the "first" word in "a[1].first = 1 line;"

Actual Results:  
No information about the first member is displayed.

Expected Results:  
Kdevelop shows that "first is of int type"

The problem seems related to preprocessor or job scheduling of included files since
kdevelop works correctly when given an output of file preprocessed by g++ i.e.

given the sample code is in file named vector_cpp11.cpp
run the following command:
g++ vector_cpp11.cpp -E -o vector_cpp11_preprocessed.cpp
open the vector_cpp11_preprocessed.cpp file in kdevelop
Kdevelop will correctly show type information for ".first" expression.
Comment 1 Maciej Cencora 2013-09-18 11:31:45 UTC
Any suggestions how to debug it?
Comment 2 Matthew Woehlke 2014-05-02 14:51:01 UTC
Seems to be a duplicate of bug 299124?
Comment 3 Milian Wolff 2014-05-03 13:11:18 UTC
*** Bug 299124 has been marked as a duplicate of this bug. ***
Comment 4 Andrew Crouthamel 2018-11-11 04:31:37 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 5 Andrew Crouthamel 2018-11-21 04:22:01 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Maciej Cencora 2018-11-21 08:08:33 UTC
Seems to work fine on 5.3