[Bug c++/68604] typeid does not allow an id-expression that denotes a non-static data member

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 10 19:15:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68604

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Hmm.  The problem here is that the operand of typeid may or may not be an
unevaluated operand, so we don't know which it is while we're parsing.

This can be worked around by writing typeid(decltype((A::i))) instead, to force
the unevaluated operand.


More information about the Gcc-bugs mailing list