[cfe-commits] r141596 - /cfe/trunk/lib/Lex/PPDirectives.cpp
Eli Friedman
eli.friedman at gmail.com
Mon Oct 10 16:35:28 PDT 2011
Author: efriedma
Date: Mon Oct 10 18:35:28 2011
New Revision: 141596
URL: http://llvm.org/viewvc/llvm-project?rev=141596&view=rev
Log:
A couple random preprocessor changes that got ported from C99 to C++11.
Modified:
cfe/trunk/lib/Lex/PPDirectives.cpp
Modified: cfe/trunk/lib/Lex/PPDirectives.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPDirectives.cpp?rev=141596&r1=141595&r2=141596&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPDirectives.cpp (original)
+++ cfe/trunk/lib/Lex/PPDirectives.cpp Mon Oct 10 18:35:28 2011
@@ -772,7 +772,9 @@
// Enforce C99 6.10.4p3: "The digit sequence shall not specify ... a
// number greater than 2147483647". C90 requires that the line # be <= 32767.
- unsigned LineLimit = Features.C99 ? 2147483648U : 32768U;
+ unsigned LineLimit = 32768U;
+ if (Features.C99 || Features.CPlusPlus0x)
+ LineLimit = 2147483648U;
if (LineNo >= LineLimit)
Diag(DigitTok, diag::ext_pp_line_too_big) << LineLimit;
@@ -1490,7 +1492,7 @@
// Read the first token after the arg list for down below.
LexUnexpandedToken(Tok);
- } else if (Features.C99) {
+ } else if (Features.C99 || Features.CPlusPlus0x) {
// C99 requires whitespace between the macro definition and the body. Emit
// a diagnostic for something like "#define X+".
Diag(Tok, diag::ext_c99_whitespace_required_after_macro_name);
More information about the cfe-commits
mailing list