[multiple changes]

2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>

        PR c/31339
        * c-typeck.c (build_unary_op <case PREINCREMENT_EXPR,
        case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
        case POSTDECREMENT_EXPR>): Return the error_mark_node
        if either the real or imaginary parts would an
        error_mark_node.

2007-05-28  Andrew Pinski  <Andrew_pinski@playstation.sony.com>

        PR c++/31339
        * typeck.c (build_unary_op <case PREINCREMENT_EXPR,
        case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
        case POSTDECREMENT_EXPR>): Return the error_mark_node
        if either the real or imaginary parts would an
        error_mark_node.

2007-05-28  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR c/31339
        * gcc.dg/boolcomplex-1.c: New test.

        PR c++/31339
        * g++.dg/ext/boolcomplex-1.c: New test

From-SVN: r125156
This commit is contained in:
Andrew Pinski 2007-05-28 17:25:25 -07:00
parent 8d9016fcd3
commit a87db577fb
7 changed files with 40 additions and 2 deletions

View File

@ -1,3 +1,12 @@
2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
PR c/31339
* c-typeck.c (build_unary_op <case PREINCREMENT_EXPR,
case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
case POSTDECREMENT_EXPR>): Return the error_mark_node
if either the real or imaginary parts would an
error_mark_node.
2007-05-28 Daniel Berlin <dberlin@dberlin.org>
* tree-ssa-dce.c (eliminate_unnecessary_stmts): Release LHS SSA

View File

@ -2908,8 +2908,11 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
arg = stabilize_reference (arg);
real = build_unary_op (REALPART_EXPR, arg, 1);
imag = build_unary_op (IMAGPART_EXPR, arg, 1);
real = build_unary_op (code, real, 1);
if (real == error_mark_node || imag == error_mark_node)
return error_mark_node;
return build2 (COMPLEX_EXPR, TREE_TYPE (arg),
build_unary_op (code, real, 1), imag);
real, imag);
}
/* Report invalid types. */

View File

@ -1,3 +1,12 @@
2007-05-28 Andrew Pinski <Andrew_pinski@playstation.sony.com>
PR c++/31339
* typeck.c (build_unary_op <case PREINCREMENT_EXPR,
case POSTINCREMENT_EXPR, case PREDECREMENT_EXPR,
case POSTDECREMENT_EXPR>): Return the error_mark_node
if either the real or imaginary parts would an
error_mark_node.
2007-05-25 Simon Martin <simartin@users.sourceforge.net>
Manuel Lopez-Ibanez <manu@gcc.gnu.org>

View File

@ -4221,8 +4221,11 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
arg = stabilize_reference (arg);
real = build_unary_op (REALPART_EXPR, arg, 1);
imag = build_unary_op (IMAGPART_EXPR, arg, 1);
real = build_unary_op (code, real, 1);
if (real == error_mark_node || imag == error_mark_node)
return error_mark_node;
return build2 (COMPLEX_EXPR, TREE_TYPE (arg),
build_unary_op (code, real, 1), imag);
real, imag);
}
/* Report invalid types. */

View File

@ -1,3 +1,11 @@
2007-05-28 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR c/31339
* gcc.dg/boolcomplex-1.c: New test.
PR c++/31339
* g++.dg/ext/boolcomplex-1.c: New test.
2007-05-28 Tobias Burnus <burnus@net-b.de>
PR fortran/32124

View File

@ -0,0 +1,3 @@
/* { dg-do compile } */
/* { dg-options "" } */
bool b = --0i == 0; /* { dg-error "lvalue required as decrement operand" } */

View File

@ -0,0 +1,3 @@
/* { dg-do compile } */
/* { dg-options "" } */
_Bool b = --0i == 0; /* { dg-error "lvalue required as decrement operand" } */