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

ASTNodeTraverser.h contains spurious inlay hints #817

Closed
HighCommander4 opened this issue Jul 12, 2021 · 1 comment
Closed

ASTNodeTraverser.h contains spurious inlay hints #817

HighCommander4 opened this issue Jul 12, 2021 · 1 comment
Assignees

Comments

@HighCommander4
Copy link

HighCommander4 commented Jul 12, 2021

Steps to reproduce

  1. Run clangd on the LLVM codebase, with --inlay-hints=true in the command line
  2. Open clang/include/clang/AST/ASTNodeTraverser.h
  3. Observe that the file contains a number of spurious parameter and type hints near the top

I suspect the spurious hints are related to this include of AttrNodeTraverse.inc near the bottom of the file. The hints look like they belong to the code in that .inc file, but incorrectly surfaced in ASTNodeTraverser.h.

@HighCommander4 HighCommander4 self-assigned this Jul 12, 2021
@HighCommander4
Copy link
Author

Here's a minimal testcase.

foo.hpp:

struct S {
  void foo(int param);
  #include "foo.inc"
};

foo.inc:

  void bar() {
    foo(42);
  }

The include being at non-global scope is important for some reason; if I move it to global scope (and adjust the included file contents accordingly), i do not get a spurious hint.

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