Re: [C++ Patch] PR 19618

2013-05-24 Thread Jason Merrill
OK. Jason

Re: [C++ Patch] PR 19618

2013-05-24 Thread Paolo Carlini
Hi, On 05/24/2013 06:12 PM, Jason Merrill wrote: On 05/24/2013 10:50 AM, Paolo Carlini wrote: + || ((TREE_CODE (type) == ENUMERAL_TYPE +&& (tree_int_cst_lt +(TYPE_SIZE (ENUM_UNDERLYING_TYPE (type)), w))) + || (TREE_CODE (type) == BOOLEAN_TYPE +

Re: [C++ Patch] PR 19618

2013-05-24 Thread Jason Merrill
On 05/24/2013 10:50 AM, Paolo Carlini wrote: + || ((TREE_CODE (type) == ENUMERAL_TYPE + && (tree_int_cst_lt + (TYPE_SIZE (ENUM_UNDERLYING_TYPE (type)), w))) + || (TREE_CODE (type) == BOOLEAN_TYPE + && tree_

Re: [C++ Patch] PR 19618

2013-05-24 Thread Paolo Carlini
Hi, On 05/24/2013 03:36 PM, Jason Merrill wrote: Why would we want to pedwarn? As far as I can tell, the standard doesn't say this is ill-formed. 9.6 says, "The value of the integral constant expression may be larger than the number of bits in the object representation (3.9) of the bit-fiel

Re: [C++ Patch] PR 19618

2013-05-24 Thread Jason Merrill
Why would we want to pedwarn? As far as I can tell, the standard doesn't say this is ill-formed. 9.6 says, "The value of the integral constant expression may be larger than the number of bits in the object representation (3.9) of the bit-field’s type; in such cases the extra bits are used as

[C++ Patch] PR 19618

2013-05-24 Thread Paolo Carlini
Hi, I think we can resolve this very old issue too: we don't warn at all for bitfields of size exceeding the type when it's bool or enum. I have no idea why historically we decided to not do that, but certainly all the modern compilers I have at hand do warn, by default, thus it seems safe to