On 2/20/19 9:08 PM, Jakub Jelinek wrote:
On Wed, Feb 20, 2019 at 01:58:58PM -1000, Jason Merrill wrote:
On 2/20/19 11:52 AM, Jakub Jelinek wrote:
On Wed, Feb 20, 2019 at 11:12:07AM -1000, Jason Merrill wrote:
(z = REALPART_EXPR <SAVE_EXPR <.ADD_OVERFLOW (0, 0)>>;, (bool) IMAGPART_EXPR <SAVE_EXPR 
<.ADD_OVERFLOW (0, 0)>>;);
which is not potential_constant_expression, but nothing called it again
and cxx_eval_constant_expression can handle it.

Yeah, that seems like a bug; C++11 shouldn't allow modification of z this
way either.

Ack.  The following version stops accepting that for C++11, but keeps
accepting for C++14 and later (so for that still needs to test
potential_constant_expression instead of is_constant_expression, plus
added a new inline function so that the code is more readable).

Can we unconditionally change is_constant_expression to
potential_constant_expression there?

Yes, passed bootstrap/regtest on x86_64-linux and i686-linux that way
and when I've tried to construct some builtin where it could make a
difference (e.g. __builtin_memcpy (&a, "b", 1);) it still didn't make a
difference.  So is this version ok for trunk?

OK, thanks.

Jason

Reply via email to