Skip to content

[clangd] Use std::make_unique (NFC) #97915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jul 6, 2024

@llvm/pr-subscribers-clangd

@llvm/pr-subscribers-clang-tools-extra

Author: Kazu Hirata (kazutakahirata)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/97915.diff

1 Files Affected:

  • (modified) clang-tools-extra/clangd/support/ThreadsafeFS.cpp (+1-1)
diff --git a/clang-tools-extra/clangd/support/ThreadsafeFS.cpp b/clang-tools-extra/clangd/support/ThreadsafeFS.cpp
index 0e249d07d2fd9..7398e4258527b 100644
--- a/clang-tools-extra/clangd/support/ThreadsafeFS.cpp
+++ b/clang-tools-extra/clangd/support/ThreadsafeFS.cpp
@@ -41,7 +41,7 @@ class VolatileFileSystem : public llvm::vfs::ProxyFileSystem {
     llvm::StringRef FileName = llvm::sys::path::filename(Path);
     if (FileName.starts_with("preamble-") && FileName.ends_with(".pch"))
       return File;
-    return std::unique_ptr<VolatileFile>(new VolatileFile(std::move(*File)));
+    return std::make_unique<VolatileFile>(std::move(*File));
   }
 
 private:

@kazutakahirata kazutakahirata merged commit f767295 into llvm:main Jul 6, 2024
10 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_clang_tidy_modernize_make_unique_clangd branch July 6, 2024 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants