diff options
author | Marek Polacek <polacek@redhat.com> | 2016-09-14 15:05:00 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2016-09-14 15:05:00 +0000 |
commit | e51fbec3ff5028d8aa7925f894444fd7920f13ae (patch) | |
tree | 9a8fc4f1bf815bc44e908dbd081d93aca40edd84 /gcc | |
parent | 13cddbc115038975a531abe3a0aed739307258db (diff) | |
download | gcc-e51fbec3ff5028d8aa7925f894444fd7920f13ae.zip gcc-e51fbec3ff5028d8aa7925f894444fd7920f13ae.tar.gz gcc-e51fbec3ff5028d8aa7925f894444fd7920f13ae.tar.bz2 |
c-common.c (c_common_truthvalue_conversion): Use false instead of 0.
* c-common.c (c_common_truthvalue_conversion): Use false instead of 0.
* c-common.h (build_unary_op): Change nonconvert parameter type to bool.
* c-omp.c (c_finish_omp_atomic): Use false instead of 0.
* c-array-notation.c (create_cmp_incr): Use false instead of 0.
(fix_array_notation_expr): Likewise.
* c-decl.c (finish_decl): Likewise.
* c-parser.c (c_parser_postfix_expression_after_primary): Likewise.
* c-typeck.c (array_to_pointer_conversion): Use true instead of 1.
(function_to_pointer_conversion): Use false instead of 0.
(convert_lvalue_to_rvalue): Likewise.
(parser_build_unary_op): Likewise.
(build_atomic_assign): Likewise.
(build_unary_op): Change nonconvert parameter type to bool, use
true/false instead of 1/0.
(build_binary_op): Use true instead of 1.
* cp-tree.h (cp_build_unary_op): Change nonconvert parameter type to
bool.
* decl2.c (one_static_initialization_or_destruction): Use true instead
of 1.
* init.c (build_vec_init): Use false instead of 0.
* pt.c (tsubst_copy_and_build): Likewise.
* semantics.c (simplify_loop_decl_cond): Likewise.
* typeck.c (rationalize_conditional_expr): Likewise.
(cp_build_binary_op): Use true instead of 1.
(cp_build_unary_op): Change nonconvert parameter type to bool. Use true
instead of 1.
(build_unary_op): Change nonconvert parameter type to bool.
(unary_complex_lvalue): Use false instead of 0.
From-SVN: r240137
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-family/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/c-family/c-common.c | 6 | ||||
-rw-r--r-- | gcc/c-family/c-common.h | 2 | ||||
-rw-r--r-- | gcc/c-family/c-omp.c | 8 | ||||
-rw-r--r-- | gcc/c/ChangeLog | 15 | ||||
-rw-r--r-- | gcc/c/c-array-notation.c | 4 | ||||
-rw-r--r-- | gcc/c/c-decl.c | 2 | ||||
-rw-r--r-- | gcc/c/c-parser.c | 8 | ||||
-rw-r--r-- | gcc/c/c-typeck.c | 46 | ||||
-rw-r--r-- | gcc/cp/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/cp/cp-tree.h | 2 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 4 | ||||
-rw-r--r-- | gcc/cp/init.c | 11 | ||||
-rw-r--r-- | gcc/cp/pt.c | 2 | ||||
-rw-r--r-- | gcc/cp/semantics.c | 2 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 33 |
16 files changed, 103 insertions, 64 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 5a2cbbe..e1fa3b7 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,9 @@ +2016-09-14 Marek Polacek <polacek@redhat.com> + + * c-common.c (c_common_truthvalue_conversion): Use false instead of 0. + * c-common.h (build_unary_op): Change nonconvert parameter type to bool. + * c-omp.c (c_finish_omp_atomic): Use false instead of 0. + 2016-09-13 David Malcolm <dmalcolm@redhat.com> * c-common.c (warn_logical_not_parentheses): Replace diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 1132a03..b561f9f 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -4599,7 +4599,7 @@ c_common_truthvalue_conversion (location_t location, tree expr) : truthvalue_false_node; case FUNCTION_DECL: - expr = build_unary_op (location, ADDR_EXPR, expr, 0); + expr = build_unary_op (location, ADDR_EXPR, expr, false); /* Fall through. */ case ADDR_EXPR: @@ -4739,10 +4739,10 @@ c_common_truthvalue_conversion (location_t location, tree expr) ? TRUTH_OR_EXPR : TRUTH_ORIF_EXPR), c_common_truthvalue_conversion (location, - build_unary_op (location, REALPART_EXPR, t, 0)), + build_unary_op (location, REALPART_EXPR, t, false)), c_common_truthvalue_conversion (location, - build_unary_op (location, IMAGPART_EXPR, t, 0)), + build_unary_op (location, IMAGPART_EXPR, t, false)), 0)); goto ret; } diff --git a/gcc/c-family/c-common.h b/gcc/c-family/c-common.h index 2e211c4..5bbf951 100644 --- a/gcc/c-family/c-common.h +++ b/gcc/c-family/c-common.h @@ -964,7 +964,7 @@ extern tree build_real_imag_expr (location_t, enum tree_code, tree); /* These functions must be defined by each front-end which implements a variant of the C language. They are used in c-common.c. */ -extern tree build_unary_op (location_t, enum tree_code, tree, int); +extern tree build_unary_op (location_t, enum tree_code, tree, bool); extern tree build_binary_op (location_t, enum tree_code, tree, tree, int); extern tree perform_integral_promotions (tree); diff --git a/gcc/c-family/c-omp.c b/gcc/c-family/c-omp.c index 3b131ed..5ccb62e 100644 --- a/gcc/c-family/c-omp.c +++ b/gcc/c-family/c-omp.c @@ -212,7 +212,7 @@ c_finish_omp_atomic (location_t loc, enum tree_code code, /* Take and save the address of the lhs. From then on we'll reference it via indirection. */ - addr = build_unary_op (loc, ADDR_EXPR, lhs, 0); + addr = build_unary_op (loc, ADDR_EXPR, lhs, false); if (addr == error_mark_node) return error_mark_node; if (!test) @@ -303,14 +303,14 @@ c_finish_omp_atomic (location_t loc, enum tree_code code, loc, x, NULL_TREE); if (rhs1 && rhs1 != lhs) { - tree rhs1addr = build_unary_op (loc, ADDR_EXPR, rhs1, 0); + tree rhs1addr = build_unary_op (loc, ADDR_EXPR, rhs1, false); if (rhs1addr == error_mark_node) return error_mark_node; x = omit_one_operand_loc (loc, type, x, rhs1addr); } if (lhs1 && lhs1 != lhs) { - tree lhs1addr = build_unary_op (loc, ADDR_EXPR, lhs1, 0); + tree lhs1addr = build_unary_op (loc, ADDR_EXPR, lhs1, false); if (lhs1addr == error_mark_node) return error_mark_node; if (code == OMP_ATOMIC_CAPTURE_OLD) @@ -325,7 +325,7 @@ c_finish_omp_atomic (location_t loc, enum tree_code code, } else if (rhs1 && rhs1 != lhs) { - tree rhs1addr = build_unary_op (loc, ADDR_EXPR, rhs1, 0); + tree rhs1addr = build_unary_op (loc, ADDR_EXPR, rhs1, false); if (rhs1addr == error_mark_node) return error_mark_node; x = omit_one_operand_loc (loc, type, x, rhs1addr); diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 4a9881d..46c2969 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,18 @@ +2016-09-14 Marek Polacek <polacek@redhat.com> + + * c-array-notation.c (create_cmp_incr): Use false instead of 0. + (fix_array_notation_expr): Likewise. + * c-decl.c (finish_decl): Likewise. + * c-parser.c (c_parser_postfix_expression_after_primary): Likewise. + * c-typeck.c (array_to_pointer_conversion): Use true instead of 1. + (function_to_pointer_conversion): Use false instead of 0. + (convert_lvalue_to_rvalue): Likewise. + (parser_build_unary_op): Likewise. + (build_atomic_assign): Likewise. + (build_unary_op): Change nonconvert parameter type to bool, use + true/false instead of 1/0. + (build_binary_op): Use true instead of 1. + 2016-09-13 David Malcolm <dmalcolm@redhat.com> * c-parser.c (c_parser_declaration_or_fndef): Update for renaming diff --git a/gcc/c/c-array-notation.c b/gcc/c/c-array-notation.c index c7cf66a..ce60911 100644 --- a/gcc/c/c-array-notation.c +++ b/gcc/c/c-array-notation.c @@ -104,7 +104,7 @@ create_cmp_incr (location_t loc, vec<an_loop_parts> *node, size_t rank, { tree var = (*node)[ii].var; tree length = an_info[0][ii].length; - (*node)[ii].incr = build_unary_op (loc, POSTINCREMENT_EXPR, var, 0); + (*node)[ii].incr = build_unary_op (loc, POSTINCREMENT_EXPR, var, false); (*node)[ii].cmp = build2 (LT_EXPR, boolean_type_node, var, length); } } @@ -1088,7 +1088,7 @@ fix_array_notation_expr (location_t location, enum tree_code code, arg = default_function_array_read_conversion (location, arg); if (code == POSTINCREMENT_EXPR || code == POSTDECREMENT_EXPR) - arg.value = build_unary_op (location, code, arg.value, 0); + arg.value = build_unary_op (location, code, arg.value, false); else if (code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR) arg = parser_build_unary_op (location, code, arg); diff --git a/gcc/c/c-decl.c b/gcc/c/c-decl.c index 8f49c35..d15b8f8 100644 --- a/gcc/c/c-decl.c +++ b/gcc/c/c-decl.c @@ -5102,7 +5102,7 @@ finish_decl (tree decl, location_t init_loc, tree init, vec<tree, va_gc> *v; /* Build "cleanup(&decl)" for the destructor. */ - cleanup = build_unary_op (input_location, ADDR_EXPR, decl, 0); + cleanup = build_unary_op (input_location, ADDR_EXPR, decl, false); vec_alloc (v, 1); v->quick_push (cleanup); cleanup = c_build_function_call_vec (DECL_SOURCE_LOCATION (decl), diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c index e71c0d5..58424a9 100644 --- a/gcc/c/c-parser.c +++ b/gcc/c/c-parser.c @@ -8478,8 +8478,8 @@ c_parser_postfix_expression_after_primary (c_parser *parser, else { expr = default_function_array_read_conversion (expr_loc, expr); - expr.value = build_unary_op (op_loc, - POSTINCREMENT_EXPR, expr.value, 0); + expr.value = build_unary_op (op_loc, POSTINCREMENT_EXPR, + expr.value, false); } set_c_expr_source_range (&expr, start, finish); expr.original_code = ERROR_MARK; @@ -8497,8 +8497,8 @@ c_parser_postfix_expression_after_primary (c_parser *parser, else { expr = default_function_array_read_conversion (expr_loc, expr); - expr.value = build_unary_op (op_loc, - POSTDECREMENT_EXPR, expr.value, 0); + expr.value = build_unary_op (op_loc, POSTDECREMENT_EXPR, + expr.value, false); } set_c_expr_source_range (&expr, start, finish); expr.original_code = ERROR_MARK; diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index 8c7f8954..4dec397 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -1880,7 +1880,7 @@ array_to_pointer_conversion (location_t loc, tree exp) "is ill-formed in C++"); } - adr = build_unary_op (loc, ADDR_EXPR, exp, 1); + adr = build_unary_op (loc, ADDR_EXPR, exp, true); return convert (ptrtype, adr); } @@ -1897,7 +1897,7 @@ function_to_pointer_conversion (location_t loc, tree exp) if (TREE_NO_WARNING (orig_exp)) TREE_NO_WARNING (exp) = 1; - return build_unary_op (loc, ADDR_EXPR, exp, 0); + return build_unary_op (loc, ADDR_EXPR, exp, false); } /* Mark EXP as read, not just set, for set but not used -Wunused @@ -2042,7 +2042,7 @@ convert_lvalue_to_rvalue (location_t loc, struct c_expr exp, vec<tree, va_gc> *params; tree nonatomic_type, tmp, tmp_addr, fndecl, func_call; tree expr_type = TREE_TYPE (exp.value); - tree expr_addr = build_unary_op (loc, ADDR_EXPR, exp.value, 0); + tree expr_addr = build_unary_op (loc, ADDR_EXPR, exp.value, false); tree seq_cst = build_int_cst (integer_type_node, MEMMODEL_SEQ_CST); gcc_assert (TYPE_ATOMIC (expr_type)); @@ -2055,7 +2055,7 @@ convert_lvalue_to_rvalue (location_t loc, struct c_expr exp, create the VAL temp variable to hold the RHS. */ nonatomic_type = build_qualified_type (expr_type, TYPE_UNQUALIFIED); tmp = create_tmp_var_raw (nonatomic_type); - tmp_addr = build_unary_op (loc, ADDR_EXPR, tmp, 0); + tmp_addr = build_unary_op (loc, ADDR_EXPR, tmp, false); TREE_ADDRESSABLE (tmp) = 1; TREE_NO_WARNING (tmp) = 1; @@ -3575,7 +3575,7 @@ parser_build_unary_op (location_t loc, enum tree_code code, struct c_expr arg) } else { - result.value = build_unary_op (loc, code, arg.value, 0); + result.value = build_unary_op (loc, code, arg.value, false); if (TREE_OVERFLOW_P (result.value) && !TREE_OVERFLOW_P (arg.value)) overflow_warning (loc, result.value); @@ -3872,7 +3872,7 @@ build_atomic_assign (location_t loc, tree lhs, enum tree_code modifycode, tree loop_label, loop_decl, done_label, done_decl; tree lhs_type = TREE_TYPE (lhs); - tree lhs_addr = build_unary_op (loc, ADDR_EXPR, lhs, 0); + tree lhs_addr = build_unary_op (loc, ADDR_EXPR, lhs, false); tree seq_cst = build_int_cst (integer_type_node, MEMMODEL_SEQ_CST); tree rhs_type = TREE_TYPE (rhs); @@ -3909,7 +3909,7 @@ build_atomic_assign (location_t loc, tree lhs, enum tree_code modifycode, if (modifycode == NOP_EXPR) { /* Build __atomic_store (&lhs, &val, SEQ_CST) */ - rhs = build_unary_op (loc, ADDR_EXPR, val, 0); + rhs = build_unary_op (loc, ADDR_EXPR, val, false); fndecl = builtin_decl_explicit (BUILT_IN_ATOMIC_STORE); params->quick_push (lhs_addr); params->quick_push (rhs); @@ -4014,12 +4014,12 @@ build_atomic_assign (location_t loc, tree lhs, enum tree_code modifycode, cas_loop: /* Create the variables and labels required for the op= form. */ old = create_tmp_var_raw (nonatomic_lhs_type); - old_addr = build_unary_op (loc, ADDR_EXPR, old, 0); + old_addr = build_unary_op (loc, ADDR_EXPR, old, false); TREE_ADDRESSABLE (old) = 1; TREE_NO_WARNING (old) = 1; newval = create_tmp_var_raw (nonatomic_lhs_type); - newval_addr = build_unary_op (loc, ADDR_EXPR, newval, 0); + newval_addr = build_unary_op (loc, ADDR_EXPR, newval, false); TREE_ADDRESSABLE (newval) = 1; TREE_NO_WARNING (newval) = 1; @@ -4112,17 +4112,17 @@ cas_loop: /* Construct and perhaps optimize a tree representation for a unary operation. CODE, a tree_code, specifies the operation and XARG is the operand. - For any CODE other than ADDR_EXPR, NOCONVERT nonzero suppresses - the default promotions (such as from short to int). - For ADDR_EXPR, the default promotions are not applied; NOCONVERT nonzero - allows non-lvalues; this is only used to handle conversion of non-lvalue - arrays to pointers in C99. + For any CODE other than ADDR_EXPR, NOCONVERT suppresses the default + promotions (such as from short to int). + For ADDR_EXPR, the default promotions are not applied; NOCONVERT allows + non-lvalues; this is only used to handle conversion of non-lvalue arrays + to pointers in C99. LOCATION is the location of the operator. */ tree build_unary_op (location_t location, enum tree_code code, tree xarg, - int noconvert) + bool noconvert) { /* No default_conversion here. It causes trouble for ADDR_EXPR. */ tree arg = xarg; @@ -4324,9 +4324,11 @@ build_unary_op (location_t location, enum tree_code code, tree xarg, if (!atomic_op) { arg = stabilize_reference (arg); - real = build_unary_op (EXPR_LOCATION (arg), REALPART_EXPR, arg, 1); - imag = build_unary_op (EXPR_LOCATION (arg), IMAGPART_EXPR, arg, 1); - real = build_unary_op (EXPR_LOCATION (arg), code, real, 1); + real = build_unary_op (EXPR_LOCATION (arg), REALPART_EXPR, arg, + true); + imag = build_unary_op (EXPR_LOCATION (arg), IMAGPART_EXPR, arg, + true); + real = build_unary_op (EXPR_LOCATION (arg), code, real, true); if (real == error_mark_node || imag == error_mark_node) return error_mark_node; ret = build2 (COMPLEX_EXPR, TREE_TYPE (arg), @@ -11513,9 +11515,9 @@ build_binary_op (location_t location, enum tree_code code, { op0 = c_save_expr (op0); real = build_unary_op (EXPR_LOCATION (orig_op0), REALPART_EXPR, - op0, 1); + op0, true); imag = build_unary_op (EXPR_LOCATION (orig_op0), IMAGPART_EXPR, - op0, 1); + op0, true); switch (code) { case MULT_EXPR: @@ -11535,9 +11537,9 @@ build_binary_op (location_t location, enum tree_code code, { op1 = c_save_expr (op1); real = build_unary_op (EXPR_LOCATION (orig_op1), REALPART_EXPR, - op1, 1); + op1, true); imag = build_unary_op (EXPR_LOCATION (orig_op1), IMAGPART_EXPR, - op1, 1); + op1, true); switch (code) { case MULT_EXPR: diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 97e9cda..df4655e 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,19 @@ +2016-09-14 Marek Polacek <polacek@redhat.com> + + * cp-tree.h (cp_build_unary_op): Change nonconvert parameter type to + bool. + * decl2.c (one_static_initialization_or_destruction): Use true instead + of 1. + * init.c (build_vec_init): Use false instead of 0. + * pt.c (tsubst_copy_and_build): Likewise. + * semantics.c (simplify_loop_decl_cond): Likewise. + * typeck.c (rationalize_conditional_expr): Likewise. + (cp_build_binary_op): Use true instead of 1. + (cp_build_unary_op): Change nonconvert parameter type to bool. Use true + instead of 1. + (build_unary_op): Change nonconvert parameter type to bool. + (unary_complex_lvalue): Use false instead of 0. + 2016-09-13 Jakub Jelinek <jakub@redhat.com> Implement P0028R4, C++17 using attribute namespaces without repetition diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index d4bfb26..f403340 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -6673,7 +6673,7 @@ extern tree build_x_unary_op (location_t, enum tree_code, cp_expr, tsubst_flags_t); extern tree cp_build_addr_expr (tree, tsubst_flags_t); -extern tree cp_build_unary_op (enum tree_code, tree, int, +extern tree cp_build_unary_op (enum tree_code, tree, bool, tsubst_flags_t); extern tree unary_complex_lvalue (enum tree_code, tree); extern tree build_x_conditional_expr (location_t, tree, tree, tree, diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index a320f92..4bdac94a 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -3775,7 +3775,7 @@ one_static_initialization_or_destruction (tree decl, tree init, bool initp) EQ_EXPR, cp_build_unary_op (PREINCREMENT_EXPR, guard, - /*noconvert=*/1, + /*noconvert=*/true, tf_warning_or_error), integer_one_node, tf_warning_or_error); @@ -3785,7 +3785,7 @@ one_static_initialization_or_destruction (tree decl, tree init, bool initp) EQ_EXPR, cp_build_unary_op (PREDECREMENT_EXPR, guard, - /*noconvert=*/1, + /*noconvert=*/true, tf_warning_or_error), integer_zero_node, tf_warning_or_error); diff --git a/gcc/cp/init.c b/gcc/cp/init.c index 5bb7f29..e869542 100644 --- a/gcc/cp/init.c +++ b/gcc/cp/init.c @@ -4096,13 +4096,14 @@ build_vec_init (tree base, tree maxindex, tree init, finish_expr_stmt (one_init); current_stmt_tree ()->stmts_are_full_exprs_p = 0; - one_init = cp_build_unary_op (PREINCREMENT_EXPR, base, 0, complain); + one_init = cp_build_unary_op (PREINCREMENT_EXPR, base, false, + complain); if (one_init == error_mark_node) errors = true; else finish_expr_stmt (one_init); - one_init = cp_build_unary_op (PREDECREMENT_EXPR, iterator, 0, + one_init = cp_build_unary_op (PREDECREMENT_EXPR, iterator, false, complain); if (one_init == error_mark_node) errors = true; @@ -4155,7 +4156,7 @@ build_vec_init (tree base, tree maxindex, tree init, finish_for_cond (build2 (GT_EXPR, boolean_type_node, iterator, build_int_cst (TREE_TYPE (iterator), -1)), for_stmt, false); - elt_init = cp_build_unary_op (PREDECREMENT_EXPR, iterator, 0, + elt_init = cp_build_unary_op (PREDECREMENT_EXPR, iterator, false, complain); if (elt_init == error_mark_node) errors = true; @@ -4272,10 +4273,10 @@ build_vec_init (tree base, tree maxindex, tree init, finish_expr_stmt (elt_init); current_stmt_tree ()->stmts_are_full_exprs_p = 0; - finish_expr_stmt (cp_build_unary_op (PREINCREMENT_EXPR, base, 0, + finish_expr_stmt (cp_build_unary_op (PREINCREMENT_EXPR, base, false, complain)); if (base2) - finish_expr_stmt (cp_build_unary_op (PREINCREMENT_EXPR, base2, 0, + finish_expr_stmt (cp_build_unary_op (PREINCREMENT_EXPR, base2, false, complain)); finish_for_stmt (for_stmt); diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b0f0664..29d8beb 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -16257,7 +16257,7 @@ tsubst_copy_and_build (tree t, case FIX_TRUNC_EXPR: RETURN (cp_build_unary_op (FIX_TRUNC_EXPR, RECUR (TREE_OPERAND (t, 0)), - 0, complain)); + false, complain)); case ADDR_EXPR: op1 = TREE_OPERAND (t, 0); diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index 9ab8439..e415732 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -588,7 +588,7 @@ simplify_loop_decl_cond (tree *cond_p, tree body) *cond_p = boolean_true_node; if_stmt = begin_if_stmt (); - cond = cp_build_unary_op (TRUTH_NOT_EXPR, cond, 0, tf_warning_or_error); + cond = cp_build_unary_op (TRUTH_NOT_EXPR, cond, false, tf_warning_or_error); finish_if_stmt_cond (cond, if_stmt); finish_break_stmt (); finish_then_clause (if_stmt); diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index a591d29..c51d6d0 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -2208,16 +2208,16 @@ rationalize_conditional_expr (enum tree_code code, tree t, op1, TREE_CODE (op1), /*overload=*/NULL, complain), - cp_build_unary_op (code, op0, 0, complain), - cp_build_unary_op (code, op1, 0, complain), + cp_build_unary_op (code, op0, false, complain), + cp_build_unary_op (code, op1, false, complain), complain); } return build_conditional_expr (loc, TREE_OPERAND (t, 0), - cp_build_unary_op (code, TREE_OPERAND (t, 1), 0, + cp_build_unary_op (code, TREE_OPERAND (t, 1), false, complain), - cp_build_unary_op (code, TREE_OPERAND (t, 2), 0, + cp_build_unary_op (code, TREE_OPERAND (t, 2), false, complain), complain); } @@ -5036,8 +5036,8 @@ cp_build_binary_op (location_t location, if (first_complex) { op0 = save_expr (op0); - real = cp_build_unary_op (REALPART_EXPR, op0, 1, complain); - imag = cp_build_unary_op (IMAGPART_EXPR, op0, 1, complain); + real = cp_build_unary_op (REALPART_EXPR, op0, true, complain); + imag = cp_build_unary_op (IMAGPART_EXPR, op0, true, complain); switch (code) { case MULT_EXPR: @@ -5056,8 +5056,8 @@ cp_build_binary_op (location_t location, else { op1 = save_expr (op1); - real = cp_build_unary_op (REALPART_EXPR, op1, 1, complain); - imag = cp_build_unary_op (IMAGPART_EXPR, op1, 1, complain); + real = cp_build_unary_op (REALPART_EXPR, op1, true, complain); + imag = cp_build_unary_op (IMAGPART_EXPR, op1, true, complain); switch (code) { case MULT_EXPR: @@ -5784,11 +5784,10 @@ cp_build_addr_expr_strict (tree arg, tsubst_flags_t complain) from aggregates to types we don't yet know we want? (Or are those cases typically errors which should be reported?) - NOCONVERT nonzero suppresses the default promotions - (such as from short to int). */ + NOCONVERT suppresses the default promotions (such as from short to int). */ tree -cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, +cp_build_unary_op (enum tree_code code, tree xarg, bool noconvert, tsubst_flags_t complain) { /* No default_conversion here. It causes trouble for ADDR_EXPR. */ @@ -5920,9 +5919,9 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, tree real, imag; arg = cp_stabilize_reference (arg); - real = cp_build_unary_op (REALPART_EXPR, arg, 1, complain); - imag = cp_build_unary_op (IMAGPART_EXPR, arg, 1, complain); - real = cp_build_unary_op (code, real, 1, complain); + real = cp_build_unary_op (REALPART_EXPR, arg, true, complain); + imag = cp_build_unary_op (IMAGPART_EXPR, arg, true, complain); + real = cp_build_unary_op (code, real, true, complain); if (real == error_mark_node || imag == error_mark_node) return error_mark_node; return build2 (COMPLEX_EXPR, TREE_TYPE (arg), @@ -6076,7 +6075,7 @@ cp_build_unary_op (enum tree_code code, tree xarg, int noconvert, /* Hook for the c-common bits that build a unary op. */ tree build_unary_op (location_t /*location*/, - enum tree_code code, tree xarg, int noconvert) + enum tree_code code, tree xarg, bool noconvert) { return cp_build_unary_op (code, xarg, noconvert, tf_warning_or_error); } @@ -6100,7 +6099,7 @@ unary_complex_lvalue (enum tree_code code, tree arg) /* Handle (a, b) used as an "lvalue". */ if (TREE_CODE (arg) == COMPOUND_EXPR) { - tree real_result = cp_build_unary_op (code, TREE_OPERAND (arg, 1), 0, + tree real_result = cp_build_unary_op (code, TREE_OPERAND (arg, 1), false, tf_warning_or_error); return build2 (COMPOUND_EXPR, TREE_TYPE (real_result), TREE_OPERAND (arg, 0), real_result); @@ -6134,7 +6133,7 @@ unary_complex_lvalue (enum tree_code code, tree arg) if (TREE_CODE (arg) == MODIFY_EXPR || TREE_CODE (arg) == INIT_EXPR) { - tree real_result = cp_build_unary_op (code, TREE_OPERAND (arg, 0), 0, + tree real_result = cp_build_unary_op (code, TREE_OPERAND (arg, 0), false, tf_warning_or_error); arg = build2 (COMPOUND_EXPR, TREE_TYPE (real_result), arg, real_result); |