diff options
Diffstat (limited to 'clang/lib/Lex/LiteralSupport.cpp')
-rw-r--r-- | clang/lib/Lex/LiteralSupport.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index 2108408377fb..9a852141c6ee 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/lib/Lex/LiteralSupport.cpp @@ -1051,7 +1051,11 @@ NumericLiteralParser::GetFloatValue(llvm::APFloat &Result) { Str = Buffer; } - return Result.convertFromString(Str, APFloat::rmNearestTiesToEven); + auto StatusOrErr = + Result.convertFromString(Str, APFloat::rmNearestTiesToEven); + assert(StatusOrErr && "Invalid floating point representation"); + return !errorToBool(StatusOrErr.takeError()) ? *StatusOrErr + : APFloat::opInvalidOp; } static inline bool IsExponentPart(char c) { |