diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-08-30 22:40:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-08-30 22:40:35 +0000 |
commit | 86325ad2b52158ccd8b10185987a6bf9e59f823f (patch) | |
tree | 490794e9afec6bf25b3bd0e77b4d08fd6c63f9f5 /clang/lib/Lex/LiteralSupport.cpp | |
parent | 924255875e31f16a61084b1acd6536184343a372 (diff) | |
download | bcm5719-llvm-86325ad2b52158ccd8b10185987a6bf9e59f823f.tar.gz bcm5719-llvm-86325ad2b52158ccd8b10185987a6bf9e59f823f.zip |
Allow C99 hexfloats in C++0x mode. This change resolves the standards
collision between C99 hexfloats and C++0x user-defined literals by
giving C99 hexfloats precedence. Also, warning about user-defined
literals that conflict with hexfloats and those that have names that
are reserved by the implementation. Fixes <rdar://problem/9940194>.
llvm-svn: 138839
Diffstat (limited to 'clang/lib/Lex/LiteralSupport.cpp')
-rw-r--r-- | clang/lib/Lex/LiteralSupport.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp index b82dbd863bf..d0e133a28a6 100644 --- a/clang/lib/Lex/LiteralSupport.cpp +++ b/clang/lib/Lex/LiteralSupport.cpp @@ -546,7 +546,7 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) { } // A binary exponent can appear with or with a '.'. If dotted, the // binary exponent is required. - if ((*s == 'p' || *s == 'P') && !PP.getLangOptions().CPlusPlus0x) { + if (*s == 'p' || *s == 'P') { const char *Exponent = s; s++; saw_exponent = true; @@ -563,9 +563,7 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) { // In C++0x, we cannot support hexadecmial floating literals because // they conflict with user-defined literals, so we warn in previous // versions of C++ by default. - if (PP.getLangOptions().CPlusPlus) - PP.Diag(TokLoc, diag::ext_hexconstant_cplusplus); - else if (!PP.getLangOptions().HexFloats) + if (!PP.getLangOptions().HexFloats) PP.Diag(TokLoc, diag::ext_hexconstant_invalid); } else if (saw_period) { PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, s-ThisTokBegin), |