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,h -- 
clang/test/SemaCXX/GH112189.cpp clang/include/clang/AST/Expr.h 
clang/lib/AST/Expr.cpp clang/lib/Sema/TreeTransform.h --diff_from_common_commit
``````````

: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/Expr.cpp b/clang/lib/AST/Expr.cpp
index ed7cfa8de..723b39fa4 100644
--- a/clang/lib/AST/Expr.cpp
+++ b/clang/lib/AST/Expr.cpp
@@ -145,15 +145,14 @@ static StringLiteral *CloneStringLiteral(const 
StringLiteral *SL,
 // Exactly follow `IgnoreParensSingleStep` (`AST/IgnoreExpr.h`)
 // We only recursively visit those subexpressions which 
`IgnoreParensSingleStep`
 // drills down to.
-Expr *Expr::CloneIfIAmAStringLiteral(ASTContext &C){
+Expr *Expr::CloneIfIAmAStringLiteral(ASTContext &C) {
   if (auto *SL = dyn_cast<StringLiteral>(this)) {
     return CloneStringLiteral(SL, C);
   }
 
   if (auto *PE = dyn_cast<ParenExpr>(this)) {
-    return new (C)
-        ParenExpr(PE->getBeginLoc(), PE->getEndLoc(),
-                  PE->getSubExpr()->CloneIfIAmAStringLiteral(C));
+    return new (C) ParenExpr(PE->getBeginLoc(), PE->getEndLoc(),
+                             PE->getSubExpr()->CloneIfIAmAStringLiteral(C));
   }
 
   if (auto *UO = dyn_cast<UnaryOperator>(this)) {
@@ -192,10 +191,8 @@ Expr *Expr::CloneIfIAmAStringLiteral(ASTContext &C){
       const bool isCondTrue = CE->isConditionTrue();
       return new (C) ChooseExpr(
           CE->getBeginLoc(), CE->getCond(),
-          isCondTrue ? CE->getLHS()->CloneIfIAmAStringLiteral(C)
-                     : CE->getLHS(),
-          isCondTrue ? CE->getRHS()
-                     : CE->getRHS()->CloneIfIAmAStringLiteral(C),
+          isCondTrue ? CE->getLHS()->CloneIfIAmAStringLiteral(C) : 
CE->getLHS(),
+          isCondTrue ? CE->getRHS() : 
CE->getRHS()->CloneIfIAmAStringLiteral(C),
           CE->getType(), CE->getValueKind(), CE->getObjectKind(),
           CE->getRParenLoc(), CE->isConditionTrue());
     }

``````````

</details>


https://github.com/llvm/llvm-project/pull/172995
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to