Commit fd1b4939 by Ian Lance Taylor

compiler: Disallow use of unary ^ on booleans.

    
    Fixes golang/go#11529.
    
    Reviewed-on: https://go-review.googlesource.com/13790

From-SVN: r227201
parent de26e239
f97d579fa8431af5cfde9b0a48604caabfd09377 d5e6af4e6dd456075a1ec1c03d0dc41cbea5eb36
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -3943,9 +3943,8 @@ Unary_expression::do_check_types(Gogo*) ...@@ -3943,9 +3943,8 @@ Unary_expression::do_check_types(Gogo*)
break; break;
case OPERATOR_XOR: case OPERATOR_XOR:
if (type->integer_type() == NULL if (type->integer_type() == NULL)
&& !type->is_boolean_type()) this->report_error(_("expected integer"));
this->report_error(_("expected integer or boolean type"));
break; break;
case OPERATOR_AND: case OPERATOR_AND:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment