[llvm] Fix C++23 build error in llvm/Support/Caching.h (PR #163545)

Victor Vianna via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 15 04:47:52 PDT 2025


https://github.com/victorvianna created https://github.com/llvm/llvm-project/pull/163545

[1] instantiates ~std::unique_ptr<MemoryBuffer>, so it must be a complete type.

[1] https://github.com/llvm/llvm-project/blob/4b89704504dde687ba7983e034cb246581fd1407/llvm/include/llvm/Support/Caching.h#L121

>From 004667b88f35dae5e0ac1fb063bf4416edd4357e Mon Sep 17 00:00:00 2001
From: Victor Hugo Vianna Silva <victorvianna at google.com>
Date: Wed, 15 Oct 2025 12:44:56 +0100
Subject: [PATCH] Fix C++23 build error in llvm/Support/Caching.h

[1] instantiates ~std::unique_ptr<MemoryBuffer>, so it must
be a complete type.

[1] https://github.com/llvm/llvm-project/blob/4b89704504dde687ba7983e034cb246581fd1407/llvm/include/llvm/Support/Caching.h#L121
---
 llvm/include/llvm/Support/Caching.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/llvm/include/llvm/Support/Caching.h b/llvm/include/llvm/Support/Caching.h
index 7fd9befbef9db..cebf071b0188f 100644
--- a/llvm/include/llvm/Support/Caching.h
+++ b/llvm/include/llvm/Support/Caching.h
@@ -17,11 +17,10 @@
 
 #include "llvm/Support/Compiler.h"
 #include "llvm/Support/Error.h"
+#include "llvm/Support/MemoryBuffer.h"
 
 namespace llvm {
 
-class MemoryBuffer;
-
 /// This class wraps an output stream for a file. Most clients should just be
 /// able to return an instance of this base class from the stream callback, but
 /// if a client needs to perform some action after the stream is written to,



More information about the llvm-commits mailing list