This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++/ARM Patch] PR 81942 ("ICE on empty constexpr constructor with C++14")
- From: Nathan Sidwell <nathan at acm dot org>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Jason Merrill <jason at redhat dot com>
- Date: Tue, 5 Sep 2017 07:18:30 -0400
- Subject: Re: [C++/ARM Patch] PR 81942 ("ICE on empty constexpr constructor with C++14")
- Authentication-results: sourceware.org; auth=none
- References: <25f223e6-8b85-d81a-51f0-2dec92838338@oracle.com>
On 09/05/2017 06:19 AM, Paolo Carlini wrote:
in this ICE on valid, a gcc_assert fires when a GOTO_EXPR is handled by
cxx_eval_constant_expression which is the translation of a "return;" on
a targetm.cxx.cdtor_returns_this target (like ARM):
I think the right way to handle this is marking such special labels with
a LABEL_DECL_CDTOR flag and using it in the returns helper function (we
already use a similar strategy with LABEL_DECL_BREAK and
LABEL_DECL_CONTINUE and the breaks and continues helpers). Then
adjusting the ICEing gcc_assert is trivial. Tested x86_64-linux and
aarch64-linux.
OK.
(heh, i notice we call the hook 'cdtor_returns_this', but AFAICT it only
applies to ctors. Not your problem though.)
nathan
--
Nathan Sidwell