[clang] [clang] fix expression classification for dependent binary operators (PR #159819)

via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 19 10:28:36 PDT 2025


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- clang/lib/AST/ExprClassification.cpp clang/test/SemaTemplate/temp_arg_template.cpp
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp
index efe721376..aeacd0dc7 100644
--- a/clang/lib/AST/ExprClassification.cpp
+++ b/clang/lib/AST/ExprClassification.cpp
@@ -602,9 +602,9 @@ 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, the
+  // convention is to classify them as a prvalue. This does not matter much, but
+  // it needs to agree with how they are created.
   if (E->getType() == Ctx.DependentTy)
     return Cl::CL_PRValue;
 

``````````

</details>


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


More information about the cfe-commits mailing list