diff --git a/llvm/lib/CodeGen/LiveDebugValues.cpp b/llvm/lib/CodeGen/LiveDebugValues.cpp index ad54378d9edc6..4d0c2462b7d3c 100644 --- a/llvm/lib/CodeGen/LiveDebugValues.cpp +++ b/llvm/lib/CodeGen/LiveDebugValues.cpp @@ -138,7 +138,10 @@ struct LocIndex { return (static_cast(Location) << 32) | Index; } - static LocIndex fromRawInteger(uint64_t ID) { + template static LocIndex fromRawInteger(IntT ID) { + static_assert(std::is_unsigned::value && + sizeof(ID) == sizeof(uint64_t), + "Cannot convert raw integer to LocIndex"); return {static_cast(ID >> 32), static_cast(ID)}; }