From f3cb394f41e4ee58c419e6601170753ef702f555 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 22 Nov 2008 07:39:03 +0000 Subject: Fix a weird inconsistency with hex floats. Previously the lexer would not eat the "-1" in "0x0p-1", but LiteralSupport would accept it when extensions are on. This caused strangeness and failures when hexfloats were properly treated as an extension (not error) in LiteralSupport. llvm-svn: 59865 --- clang/lib/Lex/Lexer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Lex/Lexer.cpp') diff --git a/clang/lib/Lex/Lexer.cpp b/clang/lib/Lex/Lexer.cpp index b4d0717cd78..1e9789b14a7 100644 --- a/clang/lib/Lex/Lexer.cpp +++ b/clang/lib/Lex/Lexer.cpp @@ -574,8 +574,8 @@ void Lexer::LexNumericConstant(Token &Result, const char *CurPtr) { return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result)); // If we have a hex FP constant, continue. - if (Features.HexFloats && - (C == '-' || C == '+') && (PrevCh == 'P' || PrevCh == 'p')) + if ((C == '-' || C == '+') && (PrevCh == 'P' || PrevCh == 'p') && + (Features.HexFloats || !Features.NoExtensions)) return LexNumericConstant(Result, ConsumeChar(CurPtr, Size, Result)); // Update the location of token as well as BufferPtr. -- cgit v1.2.3