https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67582
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Vegard Nossum from comment #3) > (In reply to Jonathan Wakely from comment #1) > > You can't dereference a void*, so why do you expect to be able to get the > > type of an invalid expression? > > I was under the impression that the expression was not actually evaluated, > but that only the *type* of the expression was evaluated. But *p is not a valid expression, so you might as well ask for typeof(this is nonsense and not valid C++). You also can't ask for sizeof(*p) for a void pointer.