https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114388
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> --- If there's a bug here, it's the value category of the ternary expression, not a problem with typeid. Whether there's a problem with the value category depends on how the DR is interpreted to apply to C++98. I'll let Jason respond to that part.