Skip to content

Commit 90a202f

Browse files
authored
[cpp23] Remove usage of std::aligned_union<> in llvm (#135146)
std::aligned_union<> is deprecated in C++23. See more details in the linked bug. Bug: https://crbug.com/388068052
1 parent d78b486 commit 90a202f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

compiler-rt/lib/orc/error.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ template <typename T> class ORC_RT_NODISCARD Expected {
367367
}
368368

369369
union {
370-
std::aligned_union_t<1, storage_type> TStorage;
371-
std::aligned_union_t<1, error_type> ErrorStorage;
370+
alignas(storage_type) char TStorage[sizeof(storage_type)];
371+
alignas(error_type) char ErrorStorage[sizeof(error_type)];
372372
};
373373

374374
bool HasError : 1;

llvm/include/llvm/ADT/TrieRawHashMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class ThreadSafeTrieRawHashMapBase {
7272
private:
7373
template <class T> struct AllocValueType {
7474
char Base[TrieContentBaseSize];
75-
std::aligned_union_t<sizeof(T), T> Content;
75+
alignas(T) char Content[sizeof(T)];
7676
};
7777

7878
protected:

0 commit comments

Comments
 (0)