================
@@ -15097,15 +15102,9 @@ ExprResult 
Sema::CreateOverloadedArraySubscriptExpr(SourceLocation LLoc,
         ExprValueKind VK = Expr::getValueKindForType(ResultTy);
         ResultTy = ResultTy.getNonLValueExprType(Context);
 
-        CallExpr *TheCall;
-        if (Method->isInstance())
-          TheCall = CXXOperatorCallExpr::Create(
-              Context, OO_Subscript, FnExpr.get(), MethodArgs, ResultTy, VK,
-              RLoc, CurFPFeatureOverrides());
-        else
-          TheCall =
-              CallExpr::Create(Context, FnExpr.get(), MethodArgs, ResultTy, VK,
-                               RLoc, CurFPFeatureOverrides());
+        CallExpr *TheCall = CXXOperatorCallExpr::Create(
----------------
SuperSodaSea wrote:

You are right, `hasCXXExplicitFunctionObjectParameter()` should imply 
`isInstance()`, so `isInstance()` is no longer needed. Passed `check-clangd` on 
my own build.

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

Diff: 
1ceaae47b2b43fd8fa5512e20e0b32a7e8f4ab5b...910ae406c88efd5cc97894dc1408606094bc0b82

https://github.com/llvm/llvm-project/pull/68485
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to