diff options
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 35f8957..961f9fe 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -6585,7 +6585,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, cp_token *token; enum tree_code tree_type, lhs_type, rhs_type; enum cp_parser_prec new_prec, lookahead_prec; - bool overloaded_p; + tree overload; /* Parse the first expression. */ lhs = cp_parser_cast_expression (parser, /*address_p=*/false, cast_p, pidk); @@ -6688,7 +6688,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, else if (tree_type == TRUTH_ORIF_EXPR) c_inhibit_evaluation_warnings -= lhs == truthvalue_true_node; - overloaded_p = false; + overload = NULL; /* ??? Currently we pass lhs_type == ERROR_MARK and rhs_type == ERROR_MARK for everything that is not a binary expression. This makes warn_about_parentheses miss some warnings that @@ -6703,7 +6703,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, lhs = build2 (tree_type, boolean_type_node, lhs, rhs); else lhs = build_x_binary_op (tree_type, lhs, lhs_type, rhs, rhs_type, - &overloaded_p, tf_warning_or_error); + &overload, tf_warning_or_error); lhs_type = tree_type; /* If the binary operator required the use of an overloaded operator, @@ -6712,7 +6712,7 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p, otherwise permissible in an integral constant-expression if at least one of the operands is of enumeration type. */ - if (overloaded_p + if (overload && cp_parser_non_integral_constant_expression (parser, NIC_OVERLOADED)) return error_mark_node; @@ -24245,8 +24245,6 @@ cp_parser_omp_for_cond (cp_parser *parser, tree decl) { tree cond = cp_parser_binary_expression (parser, false, true, PREC_NOT_OPERATOR, NULL); - bool overloaded_p; - if (cond == error_mark_node || cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON)) { @@ -24275,7 +24273,7 @@ cp_parser_omp_for_cond (cp_parser *parser, tree decl) return build_x_binary_op (TREE_CODE (cond), TREE_OPERAND (cond, 0), ERROR_MARK, TREE_OPERAND (cond, 1), ERROR_MARK, - &overloaded_p, tf_warning_or_error); + /*overload=*/NULL, tf_warning_or_error); } /* Helper function, to parse omp for increment expression. */ |