c++: constexpr trivial -fno-elide-ctors [PR104646]
commitc5de3444c4798758cdd800eca144480b4a8ef299
authorJason Merrill <jason@redhat.com>
Thu, 14 Apr 2022 19:34:14 +0000 (14 15:34 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 14 Apr 2022 21:09:57 +0000 (14 17:09 -0400)
tree83f97afcf3f3fc3813319596582573e28e4acc10
parent82536fbb8a7d150b829650378e0ba07dad5c8fb8
c++: constexpr trivial -fno-elide-ctors [PR104646]

The constexpr constructor checking code got confused by the expansion of a
trivial copy constructor; we don't need to do that checking for defaulted
ctors, anyway.

PR c++/104646

gcc/cp/ChangeLog:

* constexpr.cc (maybe_save_constexpr_fundef): Don't do extra
checks for defaulted ctors.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/constexpr-fno-elide-ctors1.C: New test.
gcc/cp/constexpr.cc
gcc/testsuite/g++.dg/cpp0x/constexpr-fno-elide-ctors1.C [new file with mode: 0644]