The Go frontend erroneously permitted unary ^ on boolean values.  This
patch by Chris Manghane fixes the problem, fixing
https://golang.org/issue/11529 .  Bootstrapped and ran Go testsuite on
x86_64-unknown-linux-gnu.  Committed to mainline.

Ian
Index: gcc/go/gofrontend/MERGE
===================================================================
--- gcc/go/gofrontend/MERGE     (revision 227193)
+++ gcc/go/gofrontend/MERGE     (working copy)
@@ -1,4 +1,4 @@
-f97d579fa8431af5cfde9b0a48604caabfd09377
+d5e6af4e6dd456075a1ec1c03d0dc41cbea5eb36
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
Index: gcc/go/gofrontend/expressions.cc
===================================================================
--- gcc/go/gofrontend/expressions.cc    (revision 227191)
+++ gcc/go/gofrontend/expressions.cc    (working copy)
@@ -3943,9 +3943,8 @@ Unary_expression::do_check_types(Gogo*)
       break;
 
     case OPERATOR_XOR:
-      if (type->integer_type() == NULL
-         && !type->is_boolean_type())
-       this->report_error(_("expected integer or boolean type"));
+      if (type->integer_type() == NULL)
+       this->report_error(_("expected integer"));
       break;
 
     case OPERATOR_AND:

Reply via email to