-
Couldn't load subscription status.
- Fork 15k
Open
Labels
clang:modulesC++20 modules and Clang Header ModulesC++20 modules and Clang Header Modules
Description
Clang 21 fails to compile <vk_mem_alloc.h>:
install-arm64-macos-clang-release-rel-out.log
FAILED: [code=1] CMakeFiles/vku.dir/extlibs/module-ports/vk_mem_alloc.cppm.o CMakeFiles/vku.dir/vk_mem_alloc_hpp.pcm
/opt/homebrew/opt/llvm/bin/clang++ -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_METAL_EXT -DVMA_DYNAMIC_VULKAN_FUNCTIONS=1 -DVMA_STATIC_VULKAN_FUNCTIONS=0 -DVULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 -isystem /Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/VULKAN_SDK/include -isystem /Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include -isystem /Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/share/unofficial-vulkan-memory-allocator-hpp/../../include -fPIC -O3 -DNDEBUG -std=gnu++23 -arch arm64 -isysroot /Applications/Xcode_16.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.5.sdk -MD -MT CMakeFiles/vku.dir/extlibs/module-ports/vk_mem_alloc.cppm.o -MF CMakeFiles/vku.dir/extlibs/module-ports/vk_mem_alloc.cppm.o.d @CMakeFiles/vku.dir/extlibs/module-ports/vk_mem_alloc.cppm.o.modmap -o CMakeFiles/vku.dir/extlibs/module-ports/vk_mem_alloc.cppm.o -c /usr/local/share/vcpkg/buildtrees/vku/src/v1.4.
In file included from /usr/local/share/vcpkg/buildtrees/vku/src/v1.4.304-e6a8f6d984.clean/extlibs/module-ports/vk_mem_alloc.cppm:3:
In file included from /Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vulkan-memory-allocator-hpp/vk_mem_alloc.hpp:5:
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4222:9: error: no matching function for call to 'VmaFree'
4222 | VmaFree(pAllocationCallbacks, ptr);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4257:9: note: in instantiation of function template specialization 'vma_delete_array<char>' requested here
4257 | vma_delete_array(allocs, str, len + 1);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4479:20: error: no matching function for call to 'VmaFree'
4479 | ~VmaVector() { VmaFree(m_Allocator.m_pCallbacks, m_pArray); }
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:5695:14: note: in instantiation of member function 'VmaVector<char, VmaStlAllocator<char>>::~VmaVector' requested here
5695 | explicit VmaStringBuilder(const VkAllocationCallbacks* allocationCallbacks) : m_Data(VmaStlAllocator<char>(allocationCallbacks)) {}
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4609:9: error: no matching function for call to 'VmaFree'
4609 | VmaFree(m_Allocator.m_pCallbacks, m_pArray);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:5720:16: note: in instantiation of member function 'VmaVector<char, VmaStlAllocator<char>>::resize' requested here
5720 | m_Data.resize(oldCount + strLen);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4479:20: error: no matching function for call to 'VmaFree'
4479 | ~VmaVector() { VmaFree(m_Allocator.m_pCallbacks, m_pArray); }
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:5840:16: note: in instantiation of member function 'VmaVector<VmaJsonWriter::StackItem, VmaStlAllocator<VmaJsonWriter::StackItem>>::~VmaVector' requested here
5840 | VmaJsonWriter::VmaJsonWriter(const VkAllocationCallbacks* pAllocationCallbacks, VmaStringBuilder& sb)
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4609:9: error: no matching function for call to 'VmaFree'
4609 | VmaFree(m_Allocator.m_pCallbacks, m_pArray);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4565:5: note: in instantiation of member function 'VmaVector<VmaJsonWriter::StackItem, VmaStlAllocator<VmaJsonWriter::StackItem>>::resize' requested here
4565 | resize(newIndex + 1);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:5862:13: note: in instantiation of member function 'VmaVector<VmaJsonWriter::StackItem, VmaStlAllocator<VmaJsonWriter::StackItem>>::push_back' requested here
5862 | m_Stack.push_back(item);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4222:9: error: no matching function for call to 'VmaFree'
4222 | VmaFree(pAllocationCallbacks, ptr);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:7013:9: note: in instantiation of function template specialization 'vma_delete_array<VmaBlockBufferImageGranularity::RegionInfo>' requested here
7013 | vma_delete_array(pAllocationCallbacks, m_RegionInfo, m_RegionCount);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4222:9: error: no matching function for call to 'VmaFree'
4222 | VmaFree(pAllocationCallbacks, ptr);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:7142:9: note: in instantiation of function template specialization 'vma_delete_array<unsigned short>' requested here
7142 | vma_delete_array(ctx.allocCallbacks, ctx.pageAllocs, m_RegionCount);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4479:20: error: no matching function for call to 'VmaFree'
4479 | ~VmaVector() { VmaFree(m_Allocator.m_pCallbacks, m_pArray); }
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:7353:26: note: in instantiation of member function 'VmaVector<VmaSuballocation, VmaStlAllocator<VmaSuballocation>>::~VmaVector' requested here
7353 | VmaBlockMetadata_Linear::VmaBlockMetadata_Linear(const VkAllocationCallbacks* pAllocationCallbacks,
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4609:9: error: no matching function for call to 'VmaFree'
4609 | VmaFree(m_Allocator.m_pCallbacks, m_pArray);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:8520:31: note: in instantiation of member function 'VmaVector<VmaSuballocation, VmaStlAllocator<VmaSuballocation>>::resize' requested here
8520 | suballocations1st.resize(nonNullItemCount);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4479:20: error: no matching function for call to 'VmaFree'
4479 | ~VmaVector() { VmaFree(m_Allocator.m_pCallbacks, m_pArray); }
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4867:22: note: in instantiation of member function 'VmaVector<VmaPoolAllocator<VmaBlockMetadata_TLSF::Block>::ItemBlock, VmaStlAllocator<VmaPoolAllocator<VmaBlockMetadata_TLSF::Block>::ItemBlock>>::~VmaVector' requested here
4867 | VmaPoolAllocator<T>::VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity)
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:8988:5: note: in instantiation of member function 'VmaPoolAllocator<VmaBlockMetadata_TLSF::Block>::VmaPoolAllocator' requested here
8988 | m_BlockAllocator(pAllocationCallbacks, INITIAL_BLOCK_ALLOC_COUNT),
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4222:9: error: no matching function for call to 'VmaFree'
4222 | VmaFree(pAllocationCallbacks, ptr);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4879:9: note: in instantiation of function template specialization 'vma_delete_array<VmaPoolAllocator<VmaBlockMetadata_TLSF::Block>::Item>' requested here
4879 | vma_delete_array(m_pAllocationCallbacks, m_ItemBlocks[i].pItems, m_ItemBlocks[i].Capacity);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:8978:24: note: in instantiation of member function 'VmaPoolAllocator<VmaBlockMetadata_TLSF::Block>::~VmaPoolAllocator' requested here
8978 | VmaBlockMetadata_TLSF::VmaBlockMetadata_TLSF(const VkAllocationCallbacks* pAllocationCallbacks,
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4609:9: error: no matching function for call to 'VmaFree'
4609 | VmaFree(m_Allocator.m_pCallbacks, m_pArray);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4504:20: note: in instantiation of member function 'VmaVector<VmaPoolAllocator<VmaBlockMetadata_TLSF::Block>::ItemBlock, VmaStlAllocator<VmaPoolAllocator<VmaBlockMetadata_TLSF::Block>::ItemBlock>>::resize' requested here
4504 | void clear() { resize(0); }
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4880:18: note: in instantiation of member function 'VmaVector<VmaPoolAllocator<VmaBlockMetadata_TLSF::Block>::ItemBlock, VmaStlAllocator<VmaPoolAllocator<VmaBlockMetadata_TLSF::Block>::ItemBlock>>::clear' requested here
4880 | m_ItemBlocks.clear();
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:8978:24: note: in instantiation of member function 'VmaPoolAllocator<VmaBlockMetadata_TLSF::Block>::~VmaPoolAllocator' requested here
8978 | VmaBlockMetadata_TLSF::VmaBlockMetadata_TLSF(const VkAllocationCallbacks* pAllocationCallbacks,
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4222:9: error: no matching function for call to 'VmaFree'
4222 | VmaFree(pAllocationCallbacks, ptr);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:8995:9: note: in instantiation of function template specialization 'vma_delete_array<VmaBlockMetadata_TLSF::Block *>' requested here
8995 | vma_delete_array(GetAllocationCallbacks(), m_FreeList, m_ListsCount);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4479:20: error: no matching function for call to 'VmaFree'
4479 | ~VmaVector() { VmaFree(m_Allocator.m_pCallbacks, m_pArray); }
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:9156:48: note: in instantiation of member function 'VmaVector<VmaBlockMetadata_TLSF::Block *, VmaStlAllocator<VmaBlockMetadata_TLSF::Block *>>::~VmaVector' requested here
9156 | VmaVector<Block*, VmaStlAllocator<Block*>> blockList(blockCount, allocator);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4479:20: error: no matching function for call to 'VmaFree'
4479 | ~VmaVector() { VmaFree(m_Allocator.m_pCallbacks, m_pArray); }
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4867:22: note: in instantiation of member function 'VmaVector<VmaPoolAllocator<VmaAllocation_T>::ItemBlock, VmaStlAllocator<VmaPoolAllocator<VmaAllocation_T>::ItemBlock>>::~VmaVector' requested here
4867 | VmaPoolAllocator<T>::VmaPoolAllocator(const VkAllocationCallbacks* pAllocationCallbacks, uint32_t firstBlockCapacity)
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:10121:11: note: in instantiation of member function 'VmaPoolAllocator<VmaAllocation_T>::VmaPoolAllocator' requested here
10121 | : m_Allocator(pAllocationCallbacks, 1024) {}
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4222:9: error: no matching function for call to 'VmaFree'
4222 | VmaFree(pAllocationCallbacks, ptr);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4879:9: note: in instantiation of function template specialization 'vma_delete_array<VmaPoolAllocator<VmaAllocation_T>::Item>' requested here
4879 | vma_delete_array(m_pAllocationCallbacks, m_ItemBlocks[i].pItems, m_ItemBlocks[i].Capacity);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:10120:14: note: in instantiation of member function 'VmaPoolAllocator<VmaAllocation_T>::~VmaPoolAllocator' requested here
10120 | explicit VmaAllocationObjectAllocator(const VkAllocationCallbacks* pAllocationCallbacks)
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4609:9: error: no matching function for call to 'VmaFree'
4609 | VmaFree(m_Allocator.m_pCallbacks, m_pArray);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4504:20: note: in instantiation of member function 'VmaVector<VmaPoolAllocator<VmaAllocation_T>::ItemBlock, VmaStlAllocator<VmaPoolAllocator<VmaAllocation_T>::ItemBlock>>::resize' requested here
4504 | void clear() { resize(0); }
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4880:18: note: in instantiation of member function 'VmaVector<VmaPoolAllocator<VmaAllocation_T>::ItemBlock, VmaStlAllocator<VmaPoolAllocator<VmaAllocation_T>::ItemBlock>>::clear' requested here
4880 | m_ItemBlocks.clear();
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:10120:14: note: in instantiation of member function 'VmaPoolAllocator<VmaAllocation_T>::~VmaPoolAllocator' requested here
10120 | explicit VmaAllocationObjectAllocator(const VkAllocationCallbacks* pAllocationCallbacks)
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:4210:5: error: no matching function for call to 'VmaFree'
4210 | VmaFree(pAllocationCallbacks, ptr);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:10207:5: note: in instantiation of function template specialization 'vma_delete<VmaBlockMetadata>' requested here
10207 | vma_delete(GetAllocationCallbacks(), m_Metadata);
| ^
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:10640:9: error: no matching function for call to 'VmaFree'
10640 | VmaFree(hAllocator, ptr);
| ^~~~~~~
/Users/runner/work/vk-gltf-viewer/vk-gltf-viewer/build/vcpkg_installed/arm64-macos-clang-release/include/vk_mem_alloc.h:10721:5: note: in instantiation of function template specialization 'vma_delete<VmaBlockMetadata>' requested here
10721 | vma_delete(allocator, m_pMetadata);
| ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
The function VmaFree is declared, but is marked as static (which should not be), therefore cannot be exported.
This is valid and GCC 15 already adopted this behavior, but MSVC and Clang have not introduced this constraint before. Also, this constraint is quite severe as many C libraries adopted this pattern (marking function as static to make a symbol has an internal linkage), which could be barrier for migration.
I can't find any information about this in Clang 21 release notes. If this change is intended, I think it is worth to mention in the release notes.
dsvensson
Metadata
Metadata
Assignees
Labels
clang:modulesC++20 modules and Clang Header ModulesC++20 modules and Clang Header Modules