c-common.c (c_common_truthvalue_conversion): Use false instead of 0.
authorMarek Polacek <polacek@redhat.com>
Wed, 14 Sep 2016 15:05:00 +0000 (15:05 +0000)
committerMarek Polacek <mpolacek@gcc.gnu.org>
Wed, 14 Sep 2016 15:05:00 +0000 (15:05 +0000)
* 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

16 files changed:
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/c-family/c-common.h
gcc/c-family/c-omp.c
gcc/c/ChangeLog
gcc/c/c-array-notation.c
gcc/c/c-decl.c
gcc/c/c-parser.c
gcc/c/c-typeck.c
gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl2.c
gcc/cp/init.c
gcc/cp/pt.c
gcc/cp/semantics.c
gcc/cp/typeck.c

index 5a2cbbef4160c07dd3ce3e63db75f2cae28ad5d2..e1fa3b7ba9e830d13078f87800d841474c1f8b03 100644 (file)
@@ -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
index 1132a03138446ef14795186f547b4d1b53ecd575..b561f9fe47e763b3983a5853fdbfd8696e122212 100644 (file)
@@ -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;
     }
index 2e211c491a52d891eb78a38da9574c4d090f4517..5bbf9511d0869b9126f1916ffa1aca125915d9a9 100644 (file)
@@ -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);
 
index 3b131ed1843109a18d72e58432ae6bfa57df0ae2..5ccb62eea501eb03cf8b9322d2aa0929f7bd6e24 100644 (file)
@@ -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);
index 4a9881d351a5fd8531552066ada950057be7afbc..46c296992b57627f262553f7a0c8b275657c1b10 100644 (file)
@@ -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
index c7cf66a2c817b3e713de3076c447dd6cf5cb579a..ce609112089c7da84d0e1e91f2c0346943512aa5 100644 (file)
@@ -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);
 
index 8f49c35237df7af672244cfdc5188fdc5bf924bf..d15b8f89b0af93476dff26f1a0da68349fe29897 100644 (file)
@@ -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),
index e71c0d5b9b543199f83232599ba760ca4c6f1d5c..58424a9e8e5b9c7f909e6e3dcbd1c14ee9f319f9 100644 (file)
@@ -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;
index 8c7f89542b7a68e3d54b955a9d0a9079e9c0b920..4dec397225ebace44c5cbfcf3260366af3deb5cd 100644 (file)
@@ -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:
index 97e9cda97ceca701406184abec4780a581582cf1..df4655ec91613fd4ef112e3c3e9f3370833ed492 100644 (file)
@@ -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
index d4bfb26d1e390252fe46edca17b0497099bd2fc9..f40334092a081a91b59b8d6820a354d00c1ce12d 100644 (file)
@@ -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, 
index a320f92d402b15b2dd61fb5495c733f210848b37..4bdac94a8e038c3bcff6c5c246edcf1df2366599 100644 (file)
@@ -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);
index 5bb7f2911179d4638a0ffd15e19bd8f76f6fa738..e869542e757097aafea6a567f369c6760befc6c5 100644 (file)
@@ -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);
index b0f06649c582f9654143efb7f660c92fad74c0b4..29d8beb33dd2aff38b68c651d79cd7490ebed08c 100644 (file)
@@ -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);
index 9ab8439077a3e6c2093c88d8b66f4e15bf62b35a..e4157325a36c9581c254321e7cb86e964df01e42 100644 (file)
@@ -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);
index a591d291602f10a51cbfb21dacb50234d89ecd3d..c51d6d0b0df2cc98510a70edd41ac0f83c213b9e 100644 (file)
@@ -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);