[clang] [Clang] Static and explicit object member functions with the same parameter-type-lists (PR #93430)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 27 09:57:55 PDT 2024


================
@@ -5834,9 +5852,12 @@ Sema::ConvertArgumentsForCall(CallExpr *Call, Expr *Fn,
 
   // C99 6.5.2.2p7 - the arguments are implicitly converted, as if by
   // assignment, to the types of the corresponding parameter, ...
+
+  bool AddressOf = isParenthetizedAndQualifiedAddressOfExpr(Fn);
   bool HasExplicitObjectParameter =
-      FDecl && FDecl->hasCXXExplicitFunctionObjectParameter();
-  unsigned ExplicitObjectParameterOffset = HasExplicitObjectParameter ? 1 : 0;
+      !AddressOf && FDecl && FDecl->hasCXXExplicitFunctionObjectParameter();
+  unsigned ExplicitObjectParameterOffset =
+      HasExplicitObjectParameter && !AddressOf ? 1 : 0;
----------------
Sirraide wrote:

```suggestion
  unsigned ExplicitObjectParameterOffset = HasExplicitObjectParameter ? 1 : 0;
```
This change seems redundant because `HasExplicitObjectParameter` already implies `!AddressOf`, right?

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


More information about the cfe-commits mailing list