[compiler-rt] [llvm] [cpp23] Remove usage of std::aligned_union<> in llvm (PR #135146)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 10 06:58:02 PDT 2025
================
@@ -367,8 +367,8 @@ template <typename T> class ORC_RT_NODISCARD Expected {
}
union {
- std::aligned_union_t<1, storage_type> TStorage;
- std::aligned_union_t<1, error_type> ErrorStorage;
+ alignas(storage_type) char TStorage[sizeof(storage_type)];
+ alignas(error_type) char ErrorStorage[sizeof(error_type)];
----------------
kuhar wrote:
We have a bunch of existing llvm code that uses `char`, e.g.: https://github.com/llvm/llvm-project/blob/4244a91be268111dd133fa4863504c4840e5361c/llvm/include/llvm/Support/TrailingObjects.h#L355
https://github.com/llvm/llvm-project/pull/135146
More information about the llvm-commits
mailing list