[PATCH] D95852: [clangd] Report xref for base methods.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 2 01:34:10 PST 2021


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:1902
+        void test(BaseBase* BB, Base* B, Derived* D) {
+          BB->func();  // refs to base's base method are not reported.
+          B->[[func]]();  // References to the base method.
----------------
ah, this is a good case!  I think we should include the base's base method as part of the refs -- because BB->func() can actually call D::func if BB points to a `Derived` object.

the fix is to add ids from `overridden_methods` recursively.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95852



More information about the cfe-commits mailing list