aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/gofrontend/expressions.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/go/gofrontend/expressions.cc')
-rw-r--r--gcc/go/gofrontend/expressions.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index 80f8b4c..20ca10b 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -5601,7 +5601,9 @@ Binary_expression::do_check_types(Gogo*)
if (left_type->integer_type() == NULL)
this->report_error(_("shift of non-integer operand"));
- if (!right_type->is_abstract()
+ if (right_type->is_string_type())
+ this->report_error(_("shift count not unsigned integer"));
+ else if (!right_type->is_abstract()
&& (right_type->integer_type() == NULL
|| !right_type->integer_type()->is_unsigned()))
this->report_error(_("shift count not unsigned integer"));