]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Fix up check for typeid on polymorphic type before C++20 [PR123347]
authorJakub Jelinek <jakub@redhat.com>
Sat, 3 Jan 2026 11:16:51 +0000 (12:16 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 3 Jan 2026 11:16:51 +0000 (12:16 +0100)
commitaae1b038f83b51205d75e7a99d57cc46d5178ae8
treea168e85e59169ca6afee82cacda58a4c648c0669
parent66fbe318e2df40ff548bc22a7abe5fa8de88429c
c++: Fix up check for typeid on polymorphic type before C++20 [PR123347]

The following testcase ICEs since TYPE_POLYMORPHIC_P macro has been
changed to allow being used only on RECORD_TYPE/UNION_TYPE.
This particular spot wasn't adjusted.

2026-01-03  Jakub Jelinek  <jakub@redhat.com>

PR c++/123347
* constexpr.cc (potential_constant_expression_1): Check for
CLASS_TYPE_P before using TYPE_POLYMORPHIC_P on TREE_TYPE (e).

* g++.dg/cpp1y/pr123347.C: New test.
gcc/cp/constexpr.cc
gcc/testsuite/g++.dg/cpp1y/pr123347.C [new file with mode: 0644]