diff options
-rw-r--r-- | llvm/include/llvm/ADT/StringRef.h | 2 | ||||
-rw-r--r-- | llvm/unittests/ADT/StringRefTest.cpp | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/llvm/include/llvm/ADT/StringRef.h b/llvm/include/llvm/ADT/StringRef.h index 94f0538e445..44b14d20dee 100644 --- a/llvm/include/llvm/ADT/StringRef.h +++ b/llvm/include/llvm/ADT/StringRef.h @@ -426,7 +426,7 @@ namespace llvm { consumeInteger(unsigned Radix, T &Result) { unsigned long long ULLVal; if (consumeUnsignedInteger(*this, Radix, ULLVal) || - static_cast<long long>(static_cast<T>(ULLVal)) != ULLVal) + static_cast<unsigned long long>(static_cast<T>(ULLVal)) != ULLVal) return true; Result = ULLVal; return false; diff --git a/llvm/unittests/ADT/StringRefTest.cpp b/llvm/unittests/ADT/StringRefTest.cpp index 40ab4e038b8..39ed71b77e9 100644 --- a/llvm/unittests/ADT/StringRefTest.cpp +++ b/llvm/unittests/ADT/StringRefTest.cpp @@ -580,6 +580,8 @@ static const char* BadStrings[] = { , "08" // illegal oct characters , "0o8" // illegal oct characters , "-123" // negative unsigned value + , "0x" + , "0b" }; |