[llvm] llvm: Replace forward declaration with include (PR #171848)

Fabrice de Gans via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 12 04:46:04 PST 2025


Steelskin wrote:

> Can you clarify how a forward declaration breaks the dylib build?

I updated the PR description. Here is the error message:
```
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/ADT/IntrusiveRefCntPtr.h(164): error C2027: use of undefined type 'llvm::vfs::FileSystem'
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/Support/SourceMgr.h(28): note: see declaration of 'llvm::vfs::FileSystem'
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/ADT/IntrusiveRefCntPtr.h(164): note: the template instantiation context (the oldest one first) is
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/Support/SourceMgr.h(100): note: see reference to class template instantiation 'llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>' being compiled
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/ADT/IntrusiveRefCntPtr.h(231): note: while compiling class template member function 'void llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>::release(void)'
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/ADT/IntrusiveRefCntPtr.h(196): note: see the first reference to 'llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>::release' in 'llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>::~IntrusiveRefCntPtr'
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h(69): note: see the first reference to 'llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>::~IntrusiveRefCntPtr' in 'llvm::SanitizerBinaryMetadataPass::__dflt_ctor_closure'
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/ADT/IntrusiveRefCntPtr.h(233): note: see reference to class template instantiation 'llvm::IntrusiveRefCntPtrInfo<T>' being compiled
        with
        [
            T=llvm::vfs::FileSystem
        ]
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/ADT/IntrusiveRefCntPtr.h(164): note: while compiling class template member function 'void llvm::IntrusiveRefCntPtrInfo<T>::release(T *)'
        with
        [
            T=llvm::vfs::FileSystem
        ]
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/ADT/IntrusiveRefCntPtr.h(233): note: see the first reference to 'llvm::IntrusiveRefCntPtrInfo<T>::release' in 'llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>::release'
        with
        [
            T=llvm::vfs::FileSystem
        ]
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/ADT/IntrusiveRefCntPtr.h(196): note: see the first reference to 'llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>::release' in 'llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>::~IntrusiveRefCntPtr'
C:\Users\fabrice\src\llvm-project\llvm\include\llvm/Transforms/Instrumentation/SanitizerBinaryMetadata.h(69): note: see the first reference to 'llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>::~IntrusiveRefCntPtr' in 'llvm::SanitizerBinaryMetadataPass::__dflt_ctor_closure'
```


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


More information about the llvm-commits mailing list