re PR c++/7503 ((x < Y ? X : Y) used for assignment causes wrong code)
PR c++/7503 * tree.c (lvalue_p_1): Disallow MIN_EXPR and MAX_EXPR as lvalues if either operand has side-effects. * typeck.c (rationalize_conditional_expr): Assert that neither operand of MIN_EXPR or MAX_EXPR has side-effects. (build_modify_expr): Add support for MIN_EXPR and MAX_EXPR. Check that the "lhs" is a valid lvalue, i.e. that neither operand of a MIN_EXPR or MAX_EXPR has a side-effect. * g++.dg/opt/pr7503-1.C: New testcase for COND_EXPR lvalues. * g++.dg/opt/pr7503-2.C: New testcase for <? and >? lvalues. * g++.dg/opt/pr7503-3.C: New testcase for invalid <? lvalue errors. * g++.dg/opt/pr7503-4.C: New testcase for <?= and >?= assignments. * g++.dg/opt/pr7503-5.C: New testcase for side-effects with <?=. From-SVN: r87810
Showing
gcc/testsuite/g++.dg/opt/pr7503-1.C
0 → 100644
gcc/testsuite/g++.dg/opt/pr7503-2.C
0 → 100644
gcc/testsuite/g++.dg/opt/pr7503-3.C
0 → 100644
gcc/testsuite/g++.dg/opt/pr7503-4.C
0 → 100644
gcc/testsuite/g++.dg/opt/pr7503-5.C
0 → 100644
Please
register
or
sign in
to comment