xgupta added subscribers: zero9178, xgupta.
xgupta added a comment.

In D115094#3174635 <https://reviews.llvm.org/D115094#3174635>, @dblaikie wrote:

> This'll at least need a test case added - though the specifics of how the 
> warning should work I'll leave up to @aaron.ballman - unless he wants some 
> second opinions. (I don't immediately have a strong feeling either way 
> regarding the current or proposed behavior)



In D115094#3176985 <https://reviews.llvm.org/D115094#3176985>, @aaron.ballman 
wrote:

> 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.

There is already a revision uploaded for this: https://reviews.llvm.org/D114787 
by @zero9178.


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
  • [PATCH] D115094: Fix -Wdecla... Shivam Gupta via Phabricator via cfe-commits

Reply via email to