https://github.com/ojhunt requested changes to this pull request.

I disagree with this change. It is attempting to change a behaviour on the 
presumption it is a bug, but I think that label is fundamentally incorrect.

It's easy to see it as an "obviously wrong" diagnostic when you have `0 ? A : 
B` but people don't write `0 ? A : B`, they write `SOME_CONSTANT ? A : B`. If 
SOME_CONSTANT is a macro, constexpr, generated, etc silencing this warning 
suppressed a bad outcome on other configurations. One of the most common 
purpose of _warnings_ rather that spec required error reports is to support 
shared view of semantics in different build environments.

This change counters that purpose, and there is no obvious reward.

Essentially: what is the argument that supports _not_ diagnosing this code as 
being a potential problem? e.g in what scenario would

```cpp
char a = 0 ? 10000 : ...;
```

not be worth diagnosing? is that 10000 ever likely to be correct?

I don't believe this PR should be landed: I believe it is a _regression_, not a 
fix.

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

Reply via email to