KFAFSP wrote:

> I feel like a better fix would be to emit the warning only once per decl group

I was also thinking that. However, I decided against it, because it is a way 
more invasive change. It change the number of diagnostics emitted, and thus the 
observed output for every user. It is easy to implement though, I believe. 

Note that this diagnostic is an error and not a warning for newer C standards 
and C++. There is also the option of demoting every subsequent error in the 
decl group to a warning and thus side-step the need to generate fix-its for 
them... But that is also invasive and might need a new diagnostic ID? The 
existing warning can't appear for the language standards where this is an 
error, people might rely on that.

> `FixItHint::CreateInsertion("")` is a bit horrible candidly.

This is also what was frustrating to me. However, I think a "do nothing" fix is 
not that far-fetched, but there isn't a canonical one, unfortunately. 
Considering fixits don't provide a guarantee anyways and the code is checked 
again afterwards. 

https://github.com/llvm/llvm-project/pull/179356
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to