When
typeid is applied to a glvalue whose type is a
polymorphic class type (
[class.virtual]), the result refers to a
std::type_info object representing the type of the most derived
object (
[intro.object]) (that is, the dynamic type) to which the
glvalue refers
. If the glvalue is obtained by applying the
unary
* operator to a pointer
and the pointer is a null pointer value (
[basic.compound]), the
typeid expression throws an exception (
[except.throw]) of
a type that would match a handler of type
std::bad_typeid
exception (
[bad.typeid])
.