diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2011-10-10 23:35:28 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2011-10-10 23:35:28 +0000 |
commit | 158ebfba7545b3a9947f87bed83ea710df95ac3d (patch) | |
tree | d90cdd9e920fe7c9f2a08d74821434e7d3da423b | |
parent | 13e1bca90dc227e1e9c30900841f8bf976c0c83e (diff) |
A couple random preprocessor changes that got ported from C99 to C++11.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141596 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Lex/PPDirectives.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp index 95f7ca9644..482dd77e7e 100644 --- a/lib/Lex/PPDirectives.cpp +++ b/lib/Lex/PPDirectives.cpp @@ -772,7 +772,9 @@ void Preprocessor::HandleLineDirective(Token &Tok) { // 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 @@ void Preprocessor::HandleDefineDirective(Token &DefineTok) { // 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); |