Version: 4.1.60 (using KDE 4.5.4) OS: Linux 'Jump to definition' and 'Jump to declaration' options work incorrectly in case of matching of the names of functions. For instance, consider the following code: //foo.h namespace { class A { int read(int a, int b); void foo(); } } //foo.cpp #include "foo.h" using namespace std; void A::foo() { read(0, 0); } int A::read(int a, int b) { } It is very simplified version of my code to reproduce, so maybe any other headers would be needed to include to reproduce fully. The result is: - the compiler correctly solves the name conflict using read() method of class as it has bigger priority - when using 'jump to definition' or 'jump to declaration' options KDevelop opens unistd.h (on Linux) header and read() function in it which is obviously not correct in terms of compilation algorithm. Reproducible: Always
works for me, you are missing a semicolon after class A { ... } in the header.
OK, let's see at the whole sources then. Two file are attached. To reproduce: 1. Create empty project (I used CMake non-GUI project) 2. Add these two files to it. Don't try to compile as it won't. 3. Go to line #456 in foo.cpp, set cursor to 'read' call and use either Jump to declaration or Jump to definition. 4. See that it jumped to unistd.h instead of the same foo.cpp source where read method is defined. Perhaps it depends on architecture, mine is x86_64. I also can confirm that the compiler really calls read() method and not a function from unistd.h.
Created attachment 55264 [details] Header to reproduce
Created attachment 55265 [details] Source to reproduce
Please strip these testcases down until you can still reproduce it. I doubt all those includes and functions are required, are they? Or at least upload the tarball of the project you created and make sure no missing files are tried to be included or such stuff.
No, I don't think they're all required. Thank you, I'll prepare proper test case without any trash. I just wanted to prevent the bug to be closed as it reproducible though in some subtle circumstances.
Well, during work on the bug related code I found I can't reproduce the bug anymore neither with testcase nor with the whole my project so I think it's some temporary fault. Clean - Build seem to fix the problem.