katzdm wrote:

@Fznamznon  Hmm...my suggested change does seem to break some tests :( But to 
circle back to your original question, I think it's not totally unexpected - a 
broader class of variable initializers are now (correctly afaict) evaluated as 
constant expressions, which could make some warnings marked as "runtime 
behavior" no longer apply. I agree though that the result is unfortunate - 
@erichkeane had pushed back on some other warnings similarly getting swallowed 
during review.

I wonder if we're taking the wrong approach here - we could also leave both of 
these warnings as "runtime only", and separately try to diagnose during 
constant evaluation. If that could work, it might make it easier to e.g., only 
diagnose overflow in a branch of a compile-time conditional if it's actually 
evaluated (which GCC seems to manage to do).

https://github.com/llvm/llvm-project/pull/89565
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to