[clang] [clang] Classify binary op value kinds use ClassifyExprValueKind when it's type-dependent (PR #202696)

Yihan Wang via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 22:01:37 PDT 2026


================
@@ -617,11 +617,12 @@ static Cl::Kinds ClassifyBinaryOp(ASTContext &Ctx, const BinaryOperator *E) {
   assert(Ctx.getLangOpts().CPlusPlus &&
          "This is only relevant for C++.");
 
-  // For binary operators which are unknown due to type dependence, the
-  // convention is to classify them as a prvalue. This does not matter much, but
-  // it needs to agree with how they are created.
+  // For binary operators which are unknown due to type dependence, use the
+  // value kind assigned when the expression was created. Dependent assignment
+  // expressions can be either lvalues or prvalues depending on whether they
+  // might resolve to an overloaded operator.
   if (E->getType() == Ctx.DependentTy)
-    return Cl::CL_PRValue;
+    return ClassifyExprValueKind(Ctx.getLangOpts(), E, E->getValueKind());
----------------
yronglin wrote:

Never mind. I create a new PR to use `ClassifyInternal`. https://github.com/llvm/llvm-project/pull/202852, Could you help review? Many thanks!

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


More information about the cfe-commits mailing list