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

Outer nested-name-specifier in pointer-to-member does not get a semantic token #2235

Closed
HighCommander4 opened this issue Nov 27, 2024 · 3 comments

Comments

@HighCommander4
Copy link

In the following code:

struct Outer {
  struct Inner {
    void foo();
  };
};

using Alias = void (Outer::Inner:: *)();

the token Outer on the last line does not get a semantic token.

@HighCommander4
Copy link
Author

Go-to-def on the affected Outer token does not work either.

@HighCommander4
Copy link
Author

It looks like the AST just... doesn't have a TypeLoc there?

The entire void (Outer::Inner:: *)() gets a MemberPointerTypeLoc, which exposes two constituent TypeLocs: a "pointee loc" which represents the function type, and a TypeLoc for the class whose member it is. The latter is a RecordTypeLoc for Outer::Inner, which does not expose a distinct TypeLoc for the Outer in the qualifier.

In other contexts where a construction like Outer::Inner occurs, the whole thing gets an ElaboratedTypeLoc wrapping the RecordTypeLoc , which exposes a NestedNameSpecifierLoc for the qualifier which exposes another RecordTypeLoc for Outer.

@HighCommander4
Copy link
Author

Filed upstream as llvm/llvm-project#118198

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant