https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88337
--- Comment #10 from Marek Polacek <mpolacek at gcc dot gnu.org> --- Author: mpolacek Date: Fri Nov 22 23:48:25 2019 New Revision: 278635 URL: https://gcc.gnu.org/viewcvs?rev=278635&root=gcc&view=rev Log: PR c++/88337 - P1327R1: Allow polymorphic typeid in constexpr. Part of P1327R1 is to allow typeid with an operand of polymorphic type in constexpr. I found that we pretty much support it already, the only tweak was to allow TYPEID_EXPR (only created in a template) in constexpr in C++20. * constexpr.c (potential_constant_expression_1): Allow a typeid expression whose operand is of polymorphic type in constexpr in C++20. * rtti.c (build_typeid): Remove obsolete FIXME comment. * g++.dg/cpp2a/constexpr-typeid1.C: New test. * g++.dg/cpp2a/constexpr-typeid2.C: New test. * g++.dg/cpp2a/constexpr-typeid3.C: New test. * g++.dg/cpp2a/constexpr-typeid4.C: New test. Added: trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid1.C trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid2.C trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid3.C trunk/gcc/testsuite/g++.dg/cpp2a/constexpr-typeid4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/constexpr.c trunk/gcc/cp/rtti.c trunk/gcc/testsuite/ChangeLog