Skip to content
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

Support code nav for dependent members in headers relying on definitions in unincluded headers #333

Open
varungandhi-src opened this issue May 19, 2023 · 0 comments
Labels

Comments

@varungandhi-src
Copy link
Contributor

varungandhi-src commented May 19, 2023

The title of the issue is a bit of a mouthful, but you can see this in #330

The problem is that template code in the iosfwd header accesses members inside forward-declared templated types, i.e. the definition is not transitively included by iosfwd itself. Rather, some other header is responsible for making sure that the right definition is included if needed.

So you can have a situation like the following:

  1. A.cpp only includes such a fwd-header (maybe it doesn't rely on any API inside). - When A.cpp is indexed, the fwd-header is also indexed.
  2. B.cpp includes the header with the definition as well as the fwd-header. - When B.cpp is indexed, the fwd-header is skipped for indexing, since in terms of preprocessor effects, there is no change.

Had the fwd-header be included in B.cpp, the result of indexing would've been different.

I'm not sure about what the best way to address this is. One thing we could do is handle templates/dependent names differently, and don't perform the header skipping optimization for them. Later, we can merge information across headers. But this may cause a lot of temporary data to be generated due to heavy use of templates in stdlib headers. 🤕

@varungandhi-src varungandhi-src added the bug Something isn't working label May 19, 2023
@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant