C++ PATCH for c++/70744 (wrong-code with x ?: y extension)
Jason Merrill
jason@redhat.com
Mon Apr 25 17:32:00 GMT 2016
On 04/25/2016 11:35 AM, Marek Polacek wrote:
> On Fri, Apr 22, 2016 at 03:28:27PM -0400, Jason Merrill wrote:
>> On Fri, Apr 22, 2016 at 2:12 PM, Marek Polacek <polacek@redhat.com> wrote:
>>> +cp_stabilize_reference (tree ref)
>>> +{
>>> + if (TREE_CODE (ref) == PREINCREMENT_EXPR
>>> + || TREE_CODE (ref) == PREDECREMENT_EXPR)
>>
>> I think we want to do this for anything stabilize_reference doesn't
>> handle specifically, not just pre..crement.
>
> Which would mean something along the lines of the following, I hope.
Yes, except let's drop this case:
> + case COMPOUND_EXPR:
because stabilize_expr will do the wrong thing for lvalue COMPOUND_EXPR.
OK with that change.
Jason
More information about the Gcc-patches
mailing list