[llvm] Fix debuginfod build failure when httplib is used. (PR #156107)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 29 14:10:09 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-debuginfo

Author: Haowei (zeroomega)

<details>
<summary>Changes</summary>

This is a follow up of adbd43250ade1d5357542d8bd7c3dfed212ddec0. The problem is HTTPServer class will lost its implicit move ctor if httplib is used. This patch adds the move ctor explicitly to solve this issue. The default move ctor is not added in the header due to a limitation that "httplib::Server" is a forward declaration and it is incomplete.

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


2 Files Affected:

- (modified) llvm/include/llvm/Debuginfod/HTTPServer.h (+1) 
- (modified) llvm/lib/Debuginfod/HTTPServer.cpp (+2) 


``````````diff
diff --git a/llvm/include/llvm/Debuginfod/HTTPServer.h b/llvm/include/llvm/Debuginfod/HTTPServer.h
index c200089200ab7..8450735a39605 100644
--- a/llvm/include/llvm/Debuginfod/HTTPServer.h
+++ b/llvm/include/llvm/Debuginfod/HTTPServer.h
@@ -104,6 +104,7 @@ class HTTPServer {
 public:
   HTTPServer();
   ~HTTPServer();
+  HTTPServer(HTTPServer&&);
 
   /// Returns true only if LLVM has been compiled with a working HTTPServer.
   static bool isAvailable();
diff --git a/llvm/lib/Debuginfod/HTTPServer.cpp b/llvm/lib/Debuginfod/HTTPServer.cpp
index 1264353ce4b33..bff95c12066b9 100644
--- a/llvm/lib/Debuginfod/HTTPServer.cpp
+++ b/llvm/lib/Debuginfod/HTTPServer.cpp
@@ -62,6 +62,8 @@ bool llvm::streamFile(HTTPServerRequest &Request, StringRef FilePath) {
   return true;
 }
 
+HTTPServer::HTTPServer(HTTPServer&&) = default;
+
 #ifdef LLVM_ENABLE_HTTPLIB
 
 bool HTTPServer::isAvailable() { return true; }

``````````

</details>


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


More information about the llvm-commits mailing list