[clang] [Sema] Fix parameter index checks on explicit object member functions (PR #165586)

via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 29 21:59:18 PDT 2025


================
@@ -123,6 +123,13 @@ inline bool isInstanceMethod(const Decl *D) {
   return false;
 }
 
+inline bool hasImplicitObjectParameter(const Decl *D) {
+  if (const auto *MethodDecl = dyn_cast<CXXMethodDecl>(D))
+    return MethodDecl->isInstance() &&
+           !MethodDecl->hasCXXExplicitFunctionObjectParameter();
+  return false;
+}
----------------
Sirraide wrote:

```suggestion
inline bool hasImplicitObjectParameter(const Decl *D) {
  if (const auto *MethodDecl = dyn_cast<CXXMethodDecl>(D))
    return MethodDecl->isImplicitObjectMemberFunction();
  return false;
}
```

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


More information about the cfe-commits mailing list