aaron.ballman added a comment.

I'm not opposed to the idea of issuing this diagnostic when it's explicitly 
enabled, but the changes aren't quite correct. `ext_mixed_decls_code` is 
defined as an `Extension` in DiagnosticSemaKinds.td, which means that these 
changes will cause us to issue a pedantic diagnostic in C99 and later mode now. 
We should not be issuing this as an extension warning in those modes.

The usual approach we have for this sort of thing is to issue two warnings:

- "blah is a C99 extension" (issued as an extension warning when compiling in a 
mode earlier than C99)
- "blah is incompatible with standards before C99" (issued when explicitly 
opting into compatibility warnings)

e.g., 
https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/DiagnosticSemaKinds.td#L575
 and 
https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/DiagnosticSemaKinds.td#L572

Also, as @dblaikie points out, the changes are missing test coverage.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115094

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

Reply via email to