https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92684
--- Comment #3 from Andrew Pinski ---
There is a defect report dealing with this in C and such.
Both are correct for C11 but would be incorrect for C90 which defines bit-field
types because of the defect report. GCC decided to follow the C90 way
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92684
--- Comment #2 from Andrew Pinski ---
bit-fields in C is a type.
while in C++, it is not.
So:
st.v2 << 3
This is not ((long)st.v2) << 3 but rather (long:45)<<3. So it gets truncated.
C11:
fff8
0xfff8
1ffffff8
1 2 f
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92684
Andrew Pinski changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
Resolution|---