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 h,cpp -- 
clang/include/clang/AST/Decl.h clang/include/clang/AST/DeclBase.h 
clang/include/clang/AST/DeclCXX.h clang/include/clang/AST/DeclObjC.h 
clang/include/clang/AST/DeclTemplate.h clang/include/clang/AST/Redeclarable.h 
clang/include/clang/Serialization/ASTReader.h clang/lib/AST/DeclCXX.cpp 
clang/lib/AST/DeclObjC.cpp clang/lib/Serialization/ASTReader.cpp 
clang/lib/Serialization/ASTReaderDecl.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/DeclBase.h 
b/clang/include/clang/AST/DeclBase.h
index ea30d1dfc..1c471b91c 100644
--- a/clang/include/clang/AST/DeclBase.h
+++ b/clang/include/clang/AST/DeclBase.h
@@ -1004,8 +1004,7 @@ protected:
 
 public:
   /// Iterates through all the redeclarations of the same decl.
-  template <bool Update = true>
-  class redecl_iterator_impl {
+  template <bool Update = true> class redecl_iterator_impl {
     /// Current - The current declaration.
     Decl *Current = nullptr;
     Decl *Starter;
@@ -1023,10 +1022,11 @@ public:
     reference operator*() const { return Current; }
     value_type operator->() const { return Current; }
 
-    redecl_iterator_impl& operator++() {
+    redecl_iterator_impl &operator++() {
       assert(Current && "Advancing while iterator has reached end");
       // Get either previous decl or latest decl.
-      Decl *Next = Update ? Current->getNextRedeclarationImpl() : 
Current->getNextRedeclarationNoUpdateImpl(); 
+      Decl *Next = Update ? Current->getNextRedeclarationImpl()
+                          : Current->getNextRedeclarationNoUpdateImpl();
       assert(Next && "Should return next redeclaration or itself, never 
null!");
       Current = (Next != Starter) ? Next : nullptr;
       return *this;
@@ -1073,7 +1073,9 @@ public:
     return noload_redecl_iterator(const_cast<Decl *>(this));
   }
 
-  noload_redecl_iterator noload_redecls_end() const { return 
noload_redecl_iterator(); }
+  noload_redecl_iterator noload_redecls_end() const {
+    return noload_redecl_iterator();
+  }
 
   /// Retrieve the previous declaration that declares the same entity
   /// as this declaration, or NULL if there is no previous declaration.
diff --git a/clang/include/clang/AST/Redeclarable.h 
b/clang/include/clang/AST/Redeclarable.h
index 2003d624e..bde0e162a 100644
--- a/clang/include/clang/AST/Redeclarable.h
+++ b/clang/include/clang/AST/Redeclarable.h
@@ -130,7 +130,8 @@ protected:
       }
 
       return Update ? static_cast<decl_type *>(cast<KnownLatest>(Link).get(D))
-        : static_cast<decl_type *>(cast<KnownLatest>(Link).getNotUpdated());
+                    : static_cast<decl_type *>(
+                          cast<KnownLatest>(Link).getNotUpdated());
     }
 
     void setPrevious(decl_type *D) {
@@ -185,11 +186,13 @@ protected:
   decl_type *First;
 
   decl_type *getNextRedeclaration() const {
-    return RedeclLink.template getPrevious</*update=*/true>(static_cast<const 
decl_type *>(this));
+    return RedeclLink.template getPrevious</*update=*/true>(
+        static_cast<const decl_type *>(this));
   }
 
   decl_type *getNextRedeclarationNoUpdate() const {
-    return RedeclLink.template getPrevious</*update=*/false>(static_cast<const 
decl_type *>(this));
+    return RedeclLink.template getPrevious</*update=*/false>(
+        static_cast<const decl_type *>(this));
   }
 
 public:
diff --git a/clang/lib/Serialization/ASTReader.cpp 
b/clang/lib/Serialization/ASTReader.cpp
index 0d9edff27..d18113fec 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -8849,7 +8849,7 @@ void ASTReader::StartTranslationUnit(ASTConsumer 
*Consumer) {
 
 unsigned ASTReader::getNumDeclsLoaded() const {
   return DeclsLoaded.size() -
-  llvm::count(DeclsLoaded.materialized(), (Decl *)nullptr);
+         llvm::count(DeclsLoaded.materialized(), (Decl *)nullptr);
 }
 
 void ASTReader::PrintStats() {
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp 
b/clang/lib/Serialization/ASTReaderDecl.cpp
index 6e180b48e..1532e48d8 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -2116,7 +2116,9 @@ void ASTDeclMerger::MergeDefinitionData(
       cast<CXXRecordDecl>(RD)->DefinitionData = &DD;
 
 #ifndef NDEBUG
-    assert(Reader.getNumDeclsLoaded() == OldLoadedSize && "We shouldn't load 
new decls during merge definition data for class");
+    assert(
+        Reader.getNumDeclsLoaded() == OldLoadedSize &&
+        "We shouldn't load new decls during merge definition data for class");
 #endif
 
     return;

``````````

</details>


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

Reply via email to