https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88337
--- Comment #9 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Not entirely true, this template case should be accepted: #include <typeinfo> struct B { virtual void f(); }; struct B2 : B { }; template<typename T> constexpr bool fn () { constexpr B2 b2; static_assert(&typeid(b2) == &typeid(B2)); return true; } static_assert (fn<int>());