PR go/49889
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Aug 2011 04:08:29 +0000 (04:08 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 4 Aug 2011 04:08:29 +0000 (04:08 +0000)
gccgo : Fixed bug 49889.
        Now the compiler emits a proper error when a function
        called in a tuple assignment statement can not be
        typed as a function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177310 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/expressions.cc

index fbd716a..8053456 100644 (file)
@@ -9682,6 +9682,8 @@ Call_result_expression::do_type()
   Function_type* fntype = ce->get_function_type();
   if (fntype == NULL)
     {
+      if (ce->issue_error())
+       this->report_error(_("expected function"));    
       this->set_is_error();
       return Type::make_error_type();
     }