18 Language support library [language.support]

18.7 Type identification [support.rtti]

18.7.2 Class bad_cast [bad.cast]

namespace std {
  class bad_cast : public exception {
  public:
    bad_cast() noexcept;
    bad_cast(const bad_cast&) noexcept;
    bad_cast& operator=(const bad_cast&) noexcept;
    virtual const char* what() const noexcept;
  };
}

The class bad_cast defines the type of objects thrown as exceptions by the implementation to report the execution of an invalid dynamic-cast expression ([expr.dynamic.cast]).

bad_cast() noexcept;

Effects: Constructs an object of class bad_cast.

Remarks: The result of calling what() on the newly constructed object is implementation-defined.

bad_cast(const bad_cast&) noexcept; bad_cast& operator=(const bad_cast&) noexcept;

Effects: Copies an object of class bad_cast.

virtual const char* what() const noexcept;

Returns: An implementation-defined ntbs.

Remarks: The message may be a null-terminated multibyte string ([multibyte.strings]), suitable for conversion and display as a wstring ([string.classes], [locale.codecvt])