cor3ntin added inline comments.

================
Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:393-398
+def warn_cxx2b_compat_warning_directive : Warning<
+  "#warning is incompatible with C++ standards before C++2b">,
+  InGroup<CXXPre2bCompat>, DefaultIgnore;
+def warn_c2x_compat_warning_directive : Warning<
+  "#warning is incompatible with C standards before C2x">,
+  InGroup<CPre2xCompat>, DefaultIgnore;
----------------
aaron.ballman wrote:
> <Not Your Problem>Someday, it would be nice if we made the tablegen for 
> diagnostics a wee bit smarter so that we don't need to use two separate 
> warning declarations for this situation. In fact, it'd be nice if tablegen 
> could just automate this pattern given how often we use it and will be using 
> it in the future.</Not Your Problem>
That would be great indeed!


================
Comment at: clang/lib/Lex/PPDirectives.cpp:1264-1273
+      if (LangOpts.CPlusPlus)
+        Diag(Result, LangOpts.CPlusPlus2b
+                         ? diag::warn_cxx2b_compat_warning_directive
+                         : diag::ext_pp_warning_directive)
+            << /*C++2b*/ 1;
+      else
+        Diag(Result, LangOpts.C2x ? diag::warn_c2x_compat_warning_directive
----------------
aaron.ballman wrote:
> Similarly (and also not your problem), it'd be nice to have a helper function 
> so that we don't need this complicated of a dance to diagnose the situation.
Agreed!


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130415/new/

https://reviews.llvm.org/D130415

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to