7 ms·
I was talking about the same line. Apparently new is a "special" operator, or there is a bug in the compiler. I also can't get a warning with g++. The problem
by cautious_int 11y ago
I was talking about the same line.
Apparently new is a "special" operator, or there is a bug in the compiler. I also can't get a warning with g++.
The problem seems to be that, as I said, [] takes any integer expression, it is there where the value gets truncated when operator sizeof or new is applied on it since they either return or take a size_t value.