]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: constexpr, trivial, and non-alias target [PR111075]
authorJason Merrill <jason@redhat.com>
Tue, 15 Apr 2025 15:23:57 +0000 (11:23 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 23 Apr 2025 09:15:38 +0000 (05:15 -0400)
commit70eaec53f3284488ee2e58991aa38a86748d8a24
tree09845fb49df5326e9afef2264716a888b62cd3d4
parent9ef0cf019935aec0975f446181fbe99eac1e2b4e
c++: constexpr, trivial, and non-alias target [PR111075]

On Darwin and other targets with !can_alias_cdtor, we instead go to
maybe_thunk_ctor, which builds a thunk function that calls the general
constructor.  And then cp_fold tries to constant-evaluate that call, and we
ICE because we don't expect to ever be asked to constant-evaluate a call to
a trivial function.

No new test because this fixes g++.dg/torture/tail-padding1.C on affected
targets.

PR c++/111075

gcc/cp/ChangeLog:

* constexpr.cc (cxx_eval_call_expression): Allow trivial
call from a thunk.

(cherry picked from commit 628aecb050bbbc4bb0bd4468c474623e20d64e21)
gcc/cp/constexpr.cc