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

Tianlan Zhou via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 30 19:02:53 PST 2024


================
@@ -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:

Yeah, with this change the CXXOperatorCall will always have an operator argument, even if the operator is static, this is intended in this PR.

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


More information about the libcxx-commits mailing list