PR c++/17880 -Wsequence-point doesn't warn inside if, while, do conditions, for beg/cond/end expressions etc.

Mark Mitchell mark@codesourcery.com
Mon Aug 25 17:29:00 GMT 2008


Manuel López-Ibáñez wrote:

>> 2008-08-12  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
>>
>>        PR c++/17880
>> cp/
>>        * semantics.c (begin_if_stmt): Call verify_sequence_points.
>>        (begin_while_stmt): Likewise.
>>        (finish_do_body): Likewise.
>>        (finish_return_stmt): Likewise.
>>        (finish_for_init_stmt): Likewise.
>>        (finish_switch_condition): Likewise.
>> testsuite/
>>        * g++.dg/warn/sequence-pt-1.C: New.
>>        * g++.dg/warn/sequence-pt-pr17880.C: New.

Does it work to add the verify_sequence_points call inside
maybe_convert_cond instead?  Then, I think you will need it in fewer places.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list