diff --git a/llvm/include/llvm/Support/ScopedPrinter.h b/llvm/include/llvm/Support/ScopedPrinter.h index 94080e85a9048..7b87fdafd68ac 100644 --- a/llvm/include/llvm/Support/ScopedPrinter.h +++ b/llvm/include/llvm/Support/ScopedPrinter.h @@ -11,6 +11,7 @@ #include "llvm/ADT/APSInt.h" #include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/STLForwardCompat.h" #include "llvm/ADT/SmallVector.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringRef.h" @@ -57,8 +58,7 @@ struct HexNumber { HexNumber(unsigned long Value) : Value(Value) {} HexNumber(unsigned long long Value) : Value(Value) {} template >> - HexNumber(EnumT Value) - : HexNumber(static_cast>(Value)) {} + HexNumber(EnumT Value) : HexNumber(llvm::to_underlying(Value)) {} uint64_t Value; }; @@ -84,7 +84,7 @@ struct FlagEntry { : Name(Name), Value(Value) {} template >> FlagEntry(StringRef Name, EnumT Value) - : FlagEntry(Name, static_cast>(Value)) {} + : FlagEntry(Name, llvm::to_underlying(Value)) {} StringRef Name; uint64_t Value;