[PATCH] D155370: [CodeComplete] Improve FunctionCanBeCall

Younan Zhang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 25 01:53:26 PDT 2023


zyounan added inline comments.


================
Comment at: clang/lib/Sema/SemaCodeComplete.cpp:1407
 
       R.FunctionCanBeCall =
           CurrentClassScope &&
----------------
The current heuristic results in the following:

```
struct Base {
  void foo(int);
};
struct Derived : Base {
  void foo(float);
};

int main() {
  Derived d;
  d.Base::^    // FunctionCanBeCall for `foo` is false.
}
```

In situations where it is intended to invoke base member functions hidden by subclasses, we shouldn't remove parentheses, IMO.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D155370



More information about the cfe-commits mailing list