[PATCH] D82739: [clangd] Improve heuristic resolution of dependent types in TargetFinder
Nathan Ridge via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Jul 9 23:11:50 PDT 2020
nridge added inline comments.
================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:196
switch (E->getStmtClass()) {
case Stmt::CXXDependentScopeMemberExprClass: {
const auto *ME = llvm::cast<CXXDependentScopeMemberExpr>(E);
----------------
hokein wrote:
> I'm doubting whether we will miss some other exprs, since we are using it to find the decls for the base expr of `CXXDependentScopeMemberExpr`.
>
> could you try the following testcase (also add it to the unittest)?
>
> ```
> struct A {
> void foo() {}
> };
> struct B {
> A getA();
> };
>
> template <typename T> struct C {
> C c;
>
> void bar() { this->c.getA().foo(); }
> };
> ```
Thank you for the example! Handling this case required a bit of additional logic, which I've now added.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D82739/new/
https://reviews.llvm.org/D82739
More information about the cfe-commits
mailing list