efriedma-quic wrote:

> No. But I am confused, isn't this just shadowing a global variable with a 
> lesser-scoped one. Are they the same? What behavior do we want here?

This is declaring, then defining, a global variable; sorry if that wasn't clear.

Probably should be an error?  It'll be confusing no matter what we do.

> However, after making the patch and testing it I am not sure what we want. Do 
> we want to cancel implicit promotions for less-than-ints that possess the 
> wraps attribute (doesn't sound spec compliant)? Or, should wrapping things 
> still undergo promotion but now wrap at different bounds than what their 
> original type specified?

I assume for your usage, you want the result of the arithmetic to be the same 
whether or not the compiler supports the "wraps" attribute, which constrains 
your choices.

> More on this, I don't see how changing implementation from attribute-based to 
> type-based resolves any of these design decisions. Neither approach is 
> necessarily easier to implement or to understand for developers, if the right 
> decisions are made in terms of behavior then the attribute approach can be 
> just as useful and predictable.

If you had a distinct canonical type, you would have had to make explicit 
decisions about a bunch of these things... and the rest would be stable 
independent of details of non-canonical type propagation.

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

Reply via email to