diff options
Diffstat (limited to 'clang/Lex')
| -rw-r--r-- | clang/Lex/LiteralSupport.cpp | 8 | ||||
| -rw-r--r-- | clang/Lex/PPExpressions.cpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/clang/Lex/LiteralSupport.cpp b/clang/Lex/LiteralSupport.cpp index 82765522d73..04282563ea9 100644 --- a/clang/Lex/LiteralSupport.cpp +++ b/clang/Lex/LiteralSupport.cpp @@ -202,10 +202,10 @@ NumericLiteralParser(const char *begin, const char *end, s = DigitsBegin = begin; saw_exponent = false; saw_period = false; - saw_float_suffix = false; isLong = false; isUnsigned = false; isLongLong = false; + isFloat = false; isImaginary = false; hadError = false; @@ -326,8 +326,8 @@ NumericLiteralParser(const char *begin, const char *end, case 'f': // FP Suffix for "float" case 'F': if (!isFPConstant) break; // Error for integer constant. - if (saw_float_suffix || isLong) break; // FF, LF invalid. - saw_float_suffix = true; + if (isFloat || isLong) break; // FF, LF invalid. + isFloat = true; continue; // Success. case 'u': case 'U': @@ -338,7 +338,7 @@ NumericLiteralParser(const char *begin, const char *end, case 'l': case 'L': if (isLong || isLongLong) break; // Cannot be repeated. - if (saw_float_suffix) break; // LF invalid. + if (isFloat) break; // LF invalid. // Check for long long. The L's need to be adjacent and the same case. if (s+1 != ThisTokEnd && s[1] == s[0]) { diff --git a/clang/Lex/PPExpressions.cpp b/clang/Lex/PPExpressions.cpp index f43243ea165..590c0eeeeff 100644 --- a/clang/Lex/PPExpressions.cpp +++ b/clang/Lex/PPExpressions.cpp @@ -161,7 +161,7 @@ static bool EvaluateValue(llvm::APSInt &Result, Token &PeekTok, if (Literal.hadError) return true; // a diagnostic was already reported. - if (Literal.isFloatingLiteral()) { + if (Literal.isFloatingLiteral() || Literal.isImaginary) { PP.Diag(PeekTok, diag::err_pp_illegal_floating_literal); return true; } |

