[clang-tools-extra] [NFC] Complete proper copying and resource cleanup in classes. (PR #118655)

via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 4 07:34:28 PST 2024


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 d6cd214dd6ae35ea50be4fdc296ef9091f762375 3b93252fa52c4055e8c294784056697e92299b9b --extensions cpp,h -- clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.h clang-tools-extra/clang-tidy/NoLintDirectiveHandler.h clang-tools-extra/clangd/ClangdLSPServer.h clang-tools-extra/clangd/ParsedAST.h clang-tools-extra/clangd/TUScheduler.cpp clang-tools-extra/clangd/TUScheduler.h clang-tools-extra/clangd/support/DirectiveTree.cpp clang-tools-extra/modularize/ModuleAssistant.cpp
``````````

</details>

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

``````````diff
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.h b/clang-tools-extra/clangd/ClangdLSPServer.h
index 8b2f4a5f0d..607478aa82 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.h
+++ b/clang-tools-extra/clangd/ClangdLSPServer.h
@@ -73,7 +73,7 @@ public:
   /// The destructor blocks on any outstanding background tasks.
   ~ClangdLSPServer();
 
-  ClangdLSPServer(const ClangdLSPServer& other) = default;
+  ClangdLSPServer(const ClangdLSPServer &other) = default;
   ClangdLSPServer &operator=(const ClangdLSPServer &other) = default;
 
   /// Run LSP server loop, communicating with the Transport provided in the
diff --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp
index 791625b17d..651e03eced 100644
--- a/clang-tools-extra/clangd/TUScheduler.cpp
+++ b/clang-tools-extra/clangd/TUScheduler.cpp
@@ -412,7 +412,8 @@ public:
       Throttler->release(ID);
   }
   PreambleThrottlerRequest(const PreambleThrottlerRequest &) = default;
-  PreambleThrottlerRequest &operator=(const PreambleThrottlerRequest &) = default;
+  PreambleThrottlerRequest &
+  operator=(const PreambleThrottlerRequest &) = default;
 
 private:
   PreambleThrottler::RequestID ID;
diff --git a/clang-tools-extra/clangd/TUScheduler.h b/clang-tools-extra/clangd/TUScheduler.h
index 4b8f3c0003..70848d2e05 100644
--- a/clang-tools-extra/clangd/TUScheduler.h
+++ b/clang-tools-extra/clangd/TUScheduler.h
@@ -243,7 +243,7 @@ public:
   ~TUScheduler();
 
   TUScheduler(const TUScheduler &other) = default;
-  TUScheduler& operator=(const TUScheduler& other) = default;
+  TUScheduler &operator=(const TUScheduler &other) = default;
 
   struct FileStats {
     std::size_t UsedBytesAST = 0;
diff --git a/clang-tools-extra/clangd/support/DirectiveTree.cpp b/clang-tools-extra/clangd/support/DirectiveTree.cpp
index f7b9113c92..333bb494a1 100644
--- a/clang-tools-extra/clangd/support/DirectiveTree.cpp
+++ b/clang-tools-extra/clangd/support/DirectiveTree.cpp
@@ -328,8 +328,9 @@ public:
   Preprocessor(const TokenStream &In, TokenStream &Out) : In(In), Out(Out) {}
   ~Preprocessor() { Out.finalize(); }
 
-  Preprocessor(const Preprocessor&) = default; // Default copy constructor
-  Preprocessor& operator=(const Preprocessor&) = default; // Default copy assignment operator
+  Preprocessor(const Preprocessor &) = default; // Default copy constructor
+  Preprocessor &
+  operator=(const Preprocessor &) = default; // Default copy assignment operator
 
   void walk(const DirectiveTree &T) {
     for (const auto &C : T.Chunks)

``````````

</details>


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


More information about the cfe-commits mailing list