We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a9673ce commit 64751e9Copy full SHA for 64751e9
llvm/include/llvm/Support/SwapByteOrder.h
@@ -14,6 +14,7 @@
14
#ifndef LLVM_SUPPORT_SWAPBYTEORDER_H
15
#define LLVM_SUPPORT_SWAPBYTEORDER_H
16
17
+#include "llvm/ADT/STLForwardCompat.h"
18
#include "llvm/ADT/bit.h"
19
#include <cstddef>
20
#include <cstdint>
@@ -82,8 +83,7 @@ inline double getSwappedBytes(double C) {
82
83
84
template <typename T>
85
inline std::enable_if_t<std::is_enum_v<T>, T> getSwappedBytes(T C) {
- return static_cast<T>(
86
- llvm::byteswap(static_cast<std::underlying_type_t<T>>(C)));
+ return static_cast<T>(llvm::byteswap(llvm::to_underlying(C)));
87
}
88
89
template<typename T>
0 commit comments