We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b9139a commit 438ba3fCopy full SHA for 438ba3f
llvm/include/llvm/Support/SwapByteOrder.h
@@ -14,7 +14,6 @@
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>
@@ -83,7 +82,8 @@ inline double getSwappedBytes(double C) {
83
82
84
template <typename T>
85
inline std::enable_if_t<std::is_enum_v<T>, T> getSwappedBytes(T C) {
86
- return static_cast<T>(llvm::byteswap(llvm::to_underlying(C)));
+ return static_cast<T>(
+ llvm::byteswap(static_cast<std::underlying_type_t<T>>(C)));
87
}
88
89
template<typename T>
0 commit comments