-
Notifications
You must be signed in to change notification settings - Fork 216
Index distinct typedef in header file #1366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Index distinct typedef in header file #1366
Conversation
69a864c to
1fb34de
Compare
|
Thanks for trying to tackle this @i-garrison - let me know when it is ready for review + merge. If you need help resolving this, I'm not sure I can help, but maybe some others may have some ideas, so please ask and we'll see what we can do. |
|
Hi @jonahgraham thanks for looking into this. I think I'm stuck at the moment because I do not understand the role of |
I think I got it right and in the unit test One issue I found with remaining couple of cases is due to my implementation of search for similar bindings in other index fragments. I used Now if I fix |
Your explanation seem reassuring - so it certainly sounds like you are going in the right direction. |
1fb34de to
c56eced
Compare
|
One more change needed is to allow promiscuous binding resolution to find local bindings. this fixes include organizer test which wants a header with typedef name; I also added a test for using declaration for completeness. |
680e5c1 to
ceecb7f
Compare
|
Looks like last thing to fix here is to return bindings in order of lookup (and just deduplicate results) which fixed PDOM search test. |
|
Hi @jonahgraham I'm a bit confused about which of JUnit variants is needed to run unit tests. IIRC a few indexer tests do not work under JUnit5 because single project / multi project variants either are not created or not working because if changes in JUnit5. I see transition to JUnit5 started some time ago, but what is the current state? |
|
JUnit5 can be used to run the whole suite - but it is a lot of work to update the tests themselves to JUnit5 API. I have updated tests to JUnit5 when I have had other work to do in that area and when I decide the effort required is worth it / the benefit from new JUnit5 features valuable enough.
I am not aware of any tests having a problem with running with JUnit5 runner. If there is a specific test(s) that you see an issue with, please let me know and I can look closer. For clarity I mean running with JUnit5 means the JUnit5 dropdown in the launch configuration. This picture is from TESTING.md -- I'm reviewing the change now. |
GDB sources contain private portable regex implementation which provides own regmatch_t typedef. If another project file references system regex.h which provides regmatch_t typedef too, indexer would not adapt that binding and instead reuse first one it encountered. Later when that other file is parsed, attempt to resolve binding for ASTName referring to regmatch_t would fail because found PDOM binding is reachable only via private implementation header which is not included. Fix this by adapting unique typedef name to make both typedefs availabe to lookup procedure which will then filter by reachable index fragment.
This allows finding unique PDOM binding for members of unnamed namespaces
…MBinding fully qualified names Signature checking was already implemented in pdomCompareTo for specific cases PDOMFunction and PDOMCPPFunctionSpecialization, but trying to compare two PDOM bindings where intermediate name seqments are a class template and related class template specialization fails because DBname is the same. Allow differentiating bindings in this case by always comparing signatures. Clean up special cases since base method now would always compare signatures. This fixes CppCallHierarcyTests.testTemplates() if base lookup in index is perfomed by just "m" and results in both class template CT::m and CT<char>::m which are now considered distinct PDOM bindings.
ceecb7f to
ed4a71c
Compare
core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/index/tests/IndexBugsTests.java
Outdated
Show resolved
Hide resolved
|
Thank you @i-garrison |
Yes, that's the window I'm using to change between JUnit5 and JUnit3. Now if I run parser tests under JUnit5 I only see 4699 unit tests are run. If I change to JUnit3 then there are 5768 tests run. Not sure what's the actual issue (could be my openjdk-21). I vaguely recall that e.g. those inheriting from |

GDB sources contain private portable regex implementation which provides own regmatch_t typedef. If another project file references system regex.h which provides regmatch_t typedef too, indexer would not adapt that binding and instead reuse first one it encountered.
Later when that other file is parsed, attempt to resolve binding for ASTName referring to regmatch_t would fail because found PDOM binding is reachable only via private implementation header which is not included.
Fix this by adapting unique typedef name to make both typedefs availabe to lookup procedure which will then filter by reachable index fragment.
This change is related to https://bugs.eclipse.org/bugs/show_bug.cgi?id=214146
Typedef in a .cc file affects other .cc filesI found very similar issue first in unrelated workspace where one project carry a header file and another one uses that same file via symlinks on the filesystem, resulting in lots of name resolution errors. To me it looks like the strategy of adapting global names for classes and other entities has it's limits but cannot suggest anything better yet.