Commit d720b70f by Ian Lance Taylor

compiler: Better error message for invalid shift operations.

From-SVN: r194501
parent 13ea799b
...@@ -5463,13 +5463,10 @@ Binary_expression::do_determine_type(const Type_context* context) ...@@ -5463,13 +5463,10 @@ Binary_expression::do_determine_type(const Type_context* context)
// Give a useful error if that happened. // Give a useful error if that happened.
if (tleft->is_abstract() if (tleft->is_abstract()
&& subcontext.type != NULL && subcontext.type != NULL
&& (this->left_->type()->integer_type() == NULL && !subcontext.may_be_abstract
|| (subcontext.type->integer_type() == NULL && subcontext.type->integer_type() == NULL)
&& subcontext.type->float_type() == NULL
&& subcontext.type->complex_type() == NULL
&& subcontext.type->interface_type() == NULL)))
this->report_error(("invalid context-determined non-integer type " 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 // The context for the right hand operand is the same as for the
// left hand operand, except for a shift operator. // left hand operand, except for a shift operator.
......
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