Let's say I have the following struct :
struct A { unsigned int a : 1; unsigned int b : 1; };
I'm interested in the type of expression a + b . While technically, bit fields are of a โtypeโ with a size smaller than int , so integral progress may need to happen, and then the result is int , as if it were happening in gcc and clang.
But since it is impossible to extract the exact type of the bit field itself, and it will always be displayed as its "large" type (ie unsigned int in this case), should the integral advance correctly occur? Because we cannot talk about exact types and their sizes for bit fields, except that they are displayed as unsigned int , in which case integral progress should not occur.
(Once again, my question is that MSVC considers unsigned int be a type of such an expression)
source share