A silly question. I just made a few tests. My expectation was that after:
uint32_t v = ~ (uint32_t) 0;
v <<= sizeof(uint32_t) * 8;
or
size_t v = ~ (size_t) 0;
v <<= sizeof(size_t) * 8;
v
shall be zero. But it's not - it's equal to original value. So for 64-bit every shift up to 63 does shift bits, but shift by 64 does nothing (equal to shift by 0).
This is controversial for me.
Is this compiler specific or by C++ standard? I'm trying gcc version 8.3.0 under linux. Params are: g++ -c -pipe -g -std=gnu++11 -Wall -W -D_REENTRANT -fPIC