aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2012-12-14 15:02:02 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-12-14 15:02:02 +0000
commitd720b70f1ae1e6756cf17e7f042a2d3fa7eed977 (patch)
tree709901bba059741421c5ab57876a94669ea449f9
parent13ea799b4ab20ae078ed754fa04b3c8766aa6954 (diff)
downloadgcc-d720b70f1ae1e6756cf17e7f042a2d3fa7eed977.zip
gcc-d720b70f1ae1e6756cf17e7f042a2d3fa7eed977.tar.gz
gcc-d720b70f1ae1e6756cf17e7f042a2d3fa7eed977.tar.bz2
compiler: Better error message for invalid shift operations.
From-SVN: r194501
-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 9da9414..f106272 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.