hokein added a comment.

>> we are missing refs in some using declarations (line 31, line32), but line 
>> 33 does have a link which seems weird
>
> They are different types of symbol (template vs function), may make a 
> difference?

You're right, the template is the reason here. Taking a closing look, the logic 
of in WalkAST.cpp 
<https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/include-cleaner/lib/WalkAST.cpp#L84>
 doesn't seem to handle well on this case.

E.g. for the following case, the `UsingShadowDecl` refers to the *primary* 
template decl, which is not marked as used or referenced. The used/referenced 
bit is only set for specialized `FunctionDecl`, so WalkAST doesn't report this 
UsingDecl location. (`EnumDecl` also has this problem).

  namespace ns {
  template<typename T>
  int func();
  }
  
  using ns::func; 
  
  int k = func<int>();


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138219/new/

https://reviews.llvm.org/D138219

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to