]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
compiler: Better error message for invalid shift operations.
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 14 Dec 2012 15:02:02 +0000 (15:02 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 14 Dec 2012 15:02:02 +0000 (15:02 +0000)
From-SVN: r194501

gcc/go/gofrontend/expressions.cc

index 9da9414c3a69a81e12aca35ec486ee89a60a723f..f10627295b8411a198e8ff34db47f484c8c8ac31 100644 (file)
@@ -5463,13 +5463,10 @@ Binary_expression::do_determine_type(const Type_context* context)
       // Give a useful error if that happened.
       if (tleft->is_abstract()
          && subcontext.type != NULL
-         && (this->left_->type()->integer_type() == NULL
-             || (subcontext.type->integer_type() == NULL
-                 && subcontext.type->float_type() == NULL
-                 && subcontext.type->complex_type() == NULL
-                 && subcontext.type->interface_type() == NULL)))
+         && !subcontext.may_be_abstract
+         && subcontext.type->integer_type() == NULL)
        this->report_error(("invalid context-determined non-integer type "
-                           "for shift operand"));
+                           "for left operand of shift"));
 
       // The context for the right hand operand is the same as for the
       // left hand operand, except for a shift operator.