[libc-commits] [llvm] [clang-tools-extra] [libc] [compiler-rt] [flang] [libcxx] [openmp] [clang] [libcxxabi] [lldb] [libunwind] [lld] [mlir] [clang] static operators should evaluate object argument (PR #68485)

Tianlan Zhou via libc-commits libc-commits at lists.llvm.org
Tue Jan 30 11:33:26 PST 2024


SuperSodaSea wrote:

https://github.com/SuperSodaSea/llvm-project/blob/1ceaae47b2b43fd8fa5512e20e0b32a7e8f4ab5b/clang-tools-extra/clangd/InlayHints.cpp#L660-L664

```diff
      if (const CXXMethodDecl *Method =
              dyn_cast_or_null<CXXMethodDecl>(Callee.Decl))
-       if (Method->isInstance() &&
-           (IsFunctor || Method->hasCXXExplicitFunctionObjectParameter()))
+       if (IsFunctor || (Method->isInstance() &&
+                         Method->hasCXXExplicitFunctionObjectParameter()))
          Args = Args.drop_front(1);
```

Here is the code need to be modified (`!Method->isInstance() && IsFunctor` also need to drop the first argument). Passed `check-clangd` on my own build.

Commit: dea08ecc0d9caf47f7e9bdac113844b8b2bfb68e

https://github.com/llvm/llvm-project/pull/68485


More information about the libc-commits mailing list