[PATCH] D82739: [clangd] Improve heuristic resolution of dependent types in TargetFinder

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 29 04:34:23 PDT 2020


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/FindTarget.cpp:172
 std::vector<const NamedDecl *> resolveDependentExprToDecls(const Expr *E) {
   assert(E->isTypeDependent());
   if (const auto *ME = dyn_cast<CXXDependentScopeMemberExpr>(E)) {
----------------
hokein wrote:
> @nridge, the assertion is not true anymore, since we have extended it to support possibly-non-dependent expressions (`callExpr`, `MemberExpr`). 
> 
> we hit this assert when opening `clang/include/clang/ASTMatchers/ASTMatchers.h`. I think we probably need to remove it and rename related function names.
a reduce case:

```
template<typename T>
class Foo {
public:
    int foo();
};

class Bar {
public:
static void k();
template <typename T> T convert() const;
};

void func();
template <typename T>
void foo2(Foo<T> t) {
    Bar::k(t.foo()).template convert<T>();
}
```


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