aboutsummaryrefslogtreecommitdiff
path: root/gcc/go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2012-12-14 15:02:02 +0000
committerIan Lance Taylor <iant@google.com>2012-12-14 15:02:02 +0000
commitcaa771dc91fe2a8fa4b2404c3dd1b49891ecfe7f (patch)
tree709901bba059741421c5ab57876a94669ea449f9 /gcc/go
parent7098cc8ba792aa4cc5571ee702f629d43ce0e321 (diff)
compiler: Better error message for invalid shift operations.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@194501 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/go')
-rw-r--r--gcc/go/gofrontend/expressions.cc9
1 files changed, 3 insertions, 6 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 9da9414c3a6..f10627295b8 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -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.