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

Younan Zhang via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jan 30 18:54:29 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(
----------------
zyn0217 wrote:

While I haven’t had time to go through this PR, these lines appear to be the reason for the test failure. We had been relying on these different CallExprs to tell whether we should drop the explicit object parameter at the clangd site (IsFunctor). And this seemingly breaks that expectation as well as changes the AST?

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


More information about the libcxx-commits mailing list