mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-29 12:56:07 +00:00

The application of constexpr to __construct_at triggers weird linker errors when building LLVM with modules enabled and C++ < 20. > ld.lld: error: undefined hidden symbol: void* std::__1::__voidify[abi:nn190000]<llvm::sys::ProcessStatistics>(llvm::sys::ProcessStatistics&) >>>> referenced by construct_at.h:52 (/usr/local/bin/../include/c++/v1/__memory/construct_at.h:52) >>>> Program.cpp.o:(llvm::sys::Wait(llvm::sys::ProcessInfo const&, std::__1::optional<unsigned int>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*, std::__1::optional<llvm::sys::ProcessStatistics>*, bool)) in archive lib/libLLVMSupport.a I suspect this is related to undefined behavior caused by the fact that construct_at is never really constexpr (which is UB NDR). I'm unsure how to meaningfully write a test for this, as I haven't been able to trigger it in smaller unit tests