c++: empty base constexpr -fno-elide-ctors [PR105245]
authorJason Merrill <jason@redhat.com>
Tue, 12 Apr 2022 21:46:59 +0000 (17:46 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 13 Apr 2022 14:17:52 +0000 (10:17 -0400)
commitec03862f809e544a9b7d28067e51597dc92a0244
treeffd41024862ee3acf24a4bcead8c5f9024b30b93
parent31350635bfd90beea79b0e9220008da12bbb5d22
c++: empty base constexpr -fno-elide-ctors [PR105245]

The patch for 100111 extended our handling of empty base elision to the case
where the derived class has no other fields, but we still need to make sure
that there's some initializer for the derived object.

PR c++/105245
PR c++/100111

gcc/cp/ChangeLog:

* constexpr.cc (cxx_eval_store_expression): Build a CONSTRUCTOR
as needed in empty base handling.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1y/constexpr-empty2.C: Add -fno-elide-constructors.
gcc/cp/constexpr.cc
gcc/testsuite/g++.dg/cpp1y/constexpr-empty2.C