================ @@ -3194,18 +3194,12 @@ bool Lexer::LexEndOfFile(Token &Result, const char *CurPtr) { SourceLocation EndLoc = getSourceLocation(BufferEnd); unsigned DiagID = diag::warn_no_newline_eof; - if (LangOpts.CPlusPlus11) { - // C++11 [lex.phases] 2.2 p2 - // Prefer the C++98 pedantic compatibility warning over the generic, - // non-extension, user-requested "missing newline at EOF" warning. - if (!Diags.isIgnored(diag::warn_cxx98_compat_no_newline_eof, EndLoc)) - DiagID = diag::warn_cxx98_compat_no_newline_eof; - } else { - // This is conforming in C2y, but is an extension in earlier language - // modes. - if (!LangOpts.C2y) - DiagID = diag::ext_no_newline_eof; - } + // C++11 [lex.phases] 2.2 p2 + // Prefer the C++98 pedantic compatibility warning over the generic, + // non-extension, user-requested "missing newline at EOF" warning. + if (LangOpts.CPlusPlus11 && ---------------- erichkeane wrote:
It isn't clear what the status of this in C++98 actually is, right? I guess this is before WG21 was all crazy about everything-as-a-DR so we don't have much guidance here from them, but it feels DR-ish for both. https://github.com/llvm/llvm-project/pull/131794 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits