Author: Aiden Grossman
Date: 2026-09-08T13:51:23-07:00
New Revision: cc5c51457347547dbac6edcfe9887ca5aeee1b3d

URL: 
https://github.com/llvm/llvm-project/commit/cc5c51457347547dbac6edcfe9887ca5aeee1b3d
DIFF: 
https://github.com/llvm/llvm-project/commit/cc5c51457347547dbac6edcfe9887ca5aeee1b3d.diff

LOG: [lldb] Fix -Wunused-template (#221815)

This warning was enabled by default in clang 23.1.0 (although reverted
for 23.1.1). These fixes still make sense to perform though. Template
definitions in headers should not use static, and others are completely
unused.

Added: 
    

Modified: 
    lldb/unittests/Protocol/ProtocolMCPServerTest.cpp
    lldb/unittests/TestingSupport/TestUtilities.h

Removed: 
    


################################################################################
diff  --git a/lldb/unittests/Protocol/ProtocolMCPServerTest.cpp 
b/lldb/unittests/Protocol/ProtocolMCPServerTest.cpp
index d83cbfd7c036d..4b07682bc5df7 100644
--- a/lldb/unittests/Protocol/ProtocolMCPServerTest.cpp
+++ b/lldb/unittests/Protocol/ProtocolMCPServerTest.cpp
@@ -211,42 +211,8 @@ class ProtocolServerMCPTest : public testing::Test {
     Response resp = promised_result.get_future().get();
     return toJSON(resp);
   }
-
-  template <typename Result>
-  Expected<json::Value>
-  Capture(llvm::unique_function<void(Reply<Result>)> &fn) {
-    std::promise<llvm::Expected<Result>> promised_result;
-    fn([&promised_result](llvm::Expected<Result> result) {
-      promised_result.set_value(std::move(result));
-    });
-    Run();
-    llvm::Expected<Result> result = promised_result.get_future().get();
-    if (!result)
-      return result.takeError();
-    return toJSON(*result);
-  }
-
-  template <typename Result, typename Params>
-  Expected<json::Value>
-  Capture(llvm::unique_function<void(const Params &, Reply<Result>)> &fn,
-          const Params &params) {
-    std::promise<llvm::Expected<Result>> promised_result;
-    fn(params, [&promised_result](llvm::Expected<Result> result) {
-      promised_result.set_value(std::move(result));
-    });
-    Run();
-    llvm::Expected<Result> result = promised_result.get_future().get();
-    if (!result)
-      return result.takeError();
-    return toJSON(*result);
-  }
 };
 
-template <typename T>
-inline testing::internal::EqMatcher<llvm::json::Value> HasJSON(T x) {
-  return testing::internal::EqMatcher<llvm::json::Value>(toJSON(x));
-}
-
 } // namespace
 
 TEST_F(ProtocolServerMCPTest, Initialization) {

diff  --git a/lldb/unittests/TestingSupport/TestUtilities.h 
b/lldb/unittests/TestingSupport/TestUtilities.h
index 68b4dbc127a7d..f322716eb6977 100644
--- a/lldb/unittests/TestingSupport/TestUtilities.h
+++ b/lldb/unittests/TestingSupport/TestUtilities.h
@@ -65,7 +65,7 @@ class TestFile {
   std::string Buffer;
 };
 
-template <typename T> static llvm::Expected<T> roundtripJSON(const T &input) {
+template <typename T> llvm::Expected<T> roundtripJSON(const T &input) {
   std::string encoded;
   llvm::raw_string_ostream OS(encoded);
   OS << toJSON(input);


        
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to