aaron.ballman added inline comments.

================
Comment at: clang/include/clang/Basic/DiagnosticLexKinds.td:698
+def warn_c2x_compat_pp_directive : Warning<
+  "use of a '#%select{elifdef|elifndef}0' directive is incompatible with C 
standards before C2x">,
+  InGroup<CPre2xCompat>, DefaultIgnore;
----------------
(You may also need to rewrap to 80 col limits.)

And do the same for the other three, so that you can use `PPElifDiag` for it.


================
Comment at: clang/lib/Lex/PPDirectives.cpp:663
+
+        Diag(Tok, DiagID) << (IsElifDef ? PED_Elifdef : PED_Elifndef) - 1;
+
----------------
I like the way you're thinking about this, but I don't like how clever the code 
is. I'd rather update the comment on `PPElifDiag` to mention 
`warn_*_compat_pp_directive` and `ext_*_pp_directive`, and then update those 
diagnostics to have a bogus select slot for the `PED_Elif` that will never be 
used.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125178

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

Reply via email to