Don't crash when referring to method other than calling it.
authorIan Lance Taylor <ian@gcc.gnu.org>
Thu, 10 Feb 2011 23:07:36 +0000 (23:07 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Thu, 10 Feb 2011 23:07:36 +0000 (23:07 +0000)
From-SVN: r170028

gcc/go/gofrontend/expressions.cc

index 1089c6da882045205c110737284ed44f042375c9..bc27480ce2950224487cd2fb14b636dca71cdabe 100644 (file)
@@ -6397,7 +6397,8 @@ Bound_method_expression::do_check_types(Gogo*)
 tree
 Bound_method_expression::do_get_tree(Translate_context*)
 {
-  gcc_unreachable();
+  error_at(this->location(), "reference to method other than calling it");
+  return error_mark_node;
 }
 
 // Make a method expression.