================
@@ -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:

Yeah, I get that.  But if this is a DR, it ALSO applies to C++98, so it isn't a 
compatibility warning in C++98.

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

Reply via email to