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 1313#ifndef LLVM_SUPPORT_ALIGNOF_H
1414#define LLVM_SUPPORT_ALIGNOF_H
1515
16- #include < type_traits >
16+ #include < algorithm >
1717
1818namespace llvm {
1919
2020// / A suitably aligned and sized character array member which can hold elements
2121// / 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.
2722template <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)...})];
3024};
3125
3226} // end namespace llvm
You can’t perform that action at this time.
0 commit comments