aaron.ballman added a comment.

In D125814#3520137 <https://reviews.llvm.org/D125814#3520137>, @jyknight wrote:

> This confuses me.
>
> Looking at behavior with default flags:
>
> We won't emit a -Wdeprecated-non-prototype warning for `int foo();`, until we 
> subsequently find `int foo(int arg) { return 5; }`.

Close, but not quite. With default flags, we won't warn for `int foo();` until 
we see a subsequent `int foo(int arg)` (regardless of whether it's a 
declaration or a definition).

> Since we definitely have the context of what's going on at that point, in 
> order to have determined that there's a conflict, what prevents doing the 
> "right thing": emitting only 1 warning (at the definition site) and 1 note 
> (at the declaration site)?

I'm going to continue to investigate; I recall arriving at this complex logic 
because I was trying to balance the deprecation warning diagnostics against the 
changes behavior diagnostics to keep the chattiness down. However, maybe this 
logic can now be simplified if I reword the diagnostic messages somewhat and 
rearrange some of the logic. I'll see what I can come up with.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125814

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

Reply via email to