summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Lexer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-11-22 07:39:03 +0000
committerChris Lattner <sabre@nondot.org>2008-11-22 07:39:03 +0000
commitf3cb394f41e4ee58c419e6601170753ef702f555 (patch)
treee84a5f5b3ae1c46b40debca39d8ef8d47d8ce2da /clang/lib/Lex/Lexer.cpp
parent5424e6d4ec69683c05d883354a3f5c1536cf98ad (diff)
downloadbcm5719-llvm-f3cb394f41e4ee58c419e6601170753ef702f555.tar.gz
bcm5719-llvm-f3cb394f41e4ee58c419e6601170753ef702f555.zip
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
Diffstat (limited to 'clang/lib/Lex/Lexer.cpp')
-rw-r--r--clang/lib/Lex/Lexer.cpp4
1 files changed, 2 insertions, 2 deletions
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.
OpenPOWER on IntegriCloud