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/include/clang/AST/TypeLoc.h clang/lib/AST/TypeLoc.cpp 
clang/lib/Sema/SemaBoundsSafety.cpp clang/lib/Sema/SemaDeclAttr.cpp 
--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/include/clang/AST/TypeLoc.h 
b/clang/include/clang/AST/TypeLoc.h
index 0cf17c463..24373361f 100644
--- a/clang/include/clang/AST/TypeLoc.h
+++ b/clang/include/clang/AST/TypeLoc.h
@@ -1317,9 +1317,7 @@ public:
   void initializeLocal(ASTContext &Context, SourceLocation Loc) {
     setAttrRange({Loc, Loc});
   }
-  void setAttrRange(SourceRange Range) {
-    getLocalData()->Range = Range;
-  }
+  void setAttrRange(SourceRange Range) { getLocalData()->Range = Range; }
   SourceRange getAttrRange() const { return getLocalData()->Range; }
 
   StringRef getAttrNameAsWritten(Sema &S) const;
diff --git a/clang/lib/Sema/SemaBoundsSafety.cpp 
b/clang/lib/Sema/SemaBoundsSafety.cpp
index a699c9d11..befef566f 100644
--- a/clang/lib/Sema/SemaBoundsSafety.cpp
+++ b/clang/lib/Sema/SemaBoundsSafety.cpp
@@ -263,16 +263,14 @@ SourceRange 
BoundsAttributedTypeLoc::getAttrNameRange(Sema &S) const {
 }
 
 static TypeSourceInfo *getTSI(const Decl *D) {
-  if (const auto* DD = dyn_cast<DeclaratorDecl>(D)) {
+  if (const auto *DD = dyn_cast<DeclaratorDecl>(D)) {
     return DD->getTypeSourceInfo();
   }
   return nullptr;
 }
 
 struct TypeLocFinder : public ConstStmtVisitor<TypeLocFinder, TypeLoc> {
-  TypeLoc VisitParenExpr(const ParenExpr* E) {
-    return Visit(E->getSubExpr());
-  }
+  TypeLoc VisitParenExpr(const ParenExpr *E) { return Visit(E->getSubExpr()); }
 
   TypeLoc VisitDeclRefExpr(const DeclRefExpr *E) {
     return getTSI(E->getDecl())->getTypeLoc();

``````````

</details>


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

Reply via email to