]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Tolerate cdtors returning this in constexpr
authorAlexandre Oliva <oliva@adacore.com>
Mon, 11 Apr 2022 15:11:09 +0000 (12:11 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Mon, 11 Apr 2022 15:11:09 +0000 (12:11 -0300)
commit5ce08ecb15b2501abea7215e3fc59646ef7a73f9
treee328283de9045ba3cd21877efe8422873ff00e65
parent396a013a5857f85d878993eda32fb2df689bb8e8
c++: Tolerate cdtors returning this in constexpr

On targets that return this from cdtors, cxx_eval_call_expression may
flag flowing off the end of a dtor.  That's preempted for ctors, and
avoided entirely when dtors return void, but when they return this,
the return value should be conceptually disregarded, without making
room for such internal ABI details to make a program ill-formed, as in
g++.dg/cpp2a/constexpr-dtor12.C on arm-eabi.

for  gcc/cp/ChangeLog

* constexpr.cc (cxx_eval_call_expression): Disregard dtor
result.
gcc/cp/constexpr.cc