File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
llvm/include/llvm/Support Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change 13
13
#ifndef LLVM_SUPPORT_ALIGNOF_H
14
14
#define LLVM_SUPPORT_ALIGNOF_H
15
15
16
- #include < type_traits >
16
+ #include < algorithm >
17
17
18
18
namespace llvm {
19
19
20
20
// / A suitably aligned and sized character array member which can hold elements
21
21
// / of any type.
22
- // /
23
- // / This template is equivalent to std::aligned_union_t<1, ...>, but we cannot
24
- // / use it due to a bug in the MSVC x86 compiler:
25
- // / https://github.com/microsoft/STL/issues/1533
26
- // / Using `alignas` here works around the bug.
27
22
template <typename T, typename ... Ts> struct AlignedCharArrayUnion {
28
- using AlignedUnion = std::aligned_union_t <1 , T, Ts...>;
29
- alignas (alignof (AlignedUnion)) char buffer[sizeof (AlignedUnion)];
23
+ alignas (T) alignas (Ts...) char buffer[std::max({sizeof (T), sizeof (Ts)...})];
30
24
};
31
25
32
26
} // end namespace llvm
You can’t perform that action at this time.
0 commit comments