Community
Participate
Working Groups
Build Identifier: M20120208-0800 Hi, the bug is related to "Bug 197989" (Headers included in different variants are not supported). I am testing trunk version (main branch from git repository). As far as I understand, from discussion about "Bug 197989", currently when we open a header file, we will get the "most significant" version (this defining the highest number of macros). That is good when using for ex. "project explorer" to open a file. But when we're clicking on #include directive in a file we want to see the "correct" header version - which was created by parsing it at that given location. As far as I understand it is possible - we're keeping "IncludedBy" relations in PDOM. The case gets more complicated when we're clicking on some identifier ("go to declaration") - we can get wrong header version, for example version where that declaration code would be inactive. That may cause some confusion. As we store location information as (file, offset) in PDOM, we cannot deduce file version from it. Any ideas about how to solve that? Reproducible: Always
Confirmed. To demonstrate, create a project with the following files: test.hpp: #ifdef WALDO int x = 42; #else int y = 42; #endif test.cpp: #define WALDO #include "test.hpp" test2.cpp: #include "test.hpp" When you follow the include from test2.cpp, it still opens the variant of test.hpp where "WALDO" is defined.