This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/67582] typeof(*p) * fails when p is void *


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]