struct data { uint8_t nibble1 : 4, nibble2 : 4; constexpr data() { nibble1 = 2; nibble2 = 4; } }; This gives me the following two compilation errors on GCC 9.2.0:
error: member 'data::nibble1' must be initialized by mem-initializer in 'constexpr' constructor error: member 'data::nibble2' must be initialized by mem-initializer in 'constexpr' constructor But I'm pretty sure my constructor intialises both of them. I've taken a look at https://en.cppreference.com/w/cpp/language/constexpr and I don't see any requirements which my constexpr constructor doesn't satisfy.
How can I get rid of this error?