re PR c++/87398 (g++ ICE on valid code: tree check: expected record_type or union_typ...
authorJakub Jelinek <jakub@redhat.com>
Tue, 25 Sep 2018 16:40:57 +0000 (18:40 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Tue, 25 Sep 2018 16:40:57 +0000 (18:40 +0200)
commit69deaf149a531fe55c058b87609f9f1c56ab6fc6
treea81d24f799f5ff07f0de4364dc757092c1195464
parente8753bb88e273b5fd1adba241edb78513aab6c39
re PR c++/87398 (g++ ICE on valid code: tree check: expected record_type or union_type or qual_union_type, have array_type in cxx_eval_constant_expression, at cp/constexpr.c:4820)

PR c++/87398
* constexpr.c (cxx_eval_constant_expression) <case OBJ_TYPE_REF>: Only
look through COMPONENT_REFs with DECL_FIELD_IS_BASE FIELD_DECLs.

* g++.dg/other/pr87398.C: New test.
* g++.dg/cpp2a/constexpr-virtual10.C: New test.
* g++.dg/cpp2a/constexpr-virtual11.C: New test.

From-SVN: r264580
gcc/cp/ChangeLog
gcc/cp/constexpr.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp2a/constexpr-virtual10.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp2a/constexpr-virtual11.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/pr87398.C [new file with mode: 0644]