diff options
Diffstat (limited to 'clang/lib/Lex/LiteralSupport.cpp')
-rw-r--r-- | clang/lib/Lex/LiteralSupport.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index 2108408377f..66309183a14 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/lib/Lex/LiteralSupport.cpp @@ -1051,7 +1051,10 @@ 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 StatusOrErr ? *StatusOrErr : APFloat::opInvalidOp; } static inline bool IsExponentPart(char c) { |