aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-08-04 04:08:29 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-08-04 04:08:29 +0000
commit22508caed3ac82df7826ca23e9dd8ad0e3474cc7 (patch)
treec16363bf304433f7ab24984146c3b3bf25c73ba9
parentea6c2b0e960aa4be55b65a4f4954ac7b461d4b55 (diff)
downloadgcc-22508caed3ac82df7826ca23e9dd8ad0e3474cc7.zip
gcc-22508caed3ac82df7826ca23e9dd8ad0e3474cc7.tar.gz
gcc-22508caed3ac82df7826ca23e9dd8ad0e3474cc7.tar.bz2
re PR go/49889 (Calling a function whose name is obscured by a local variable does not produce an error)
PR go/49889 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. From-SVN: r177310
-rw-r--r--gcc/go/gofrontend/expressions.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/expressions.cc b/gcc/go/gofrontend/expressions.cc
index fbd716a..8053456 100644
--- a/gcc/go/gofrontend/expressions.cc
+++ b/gcc/go/gofrontend/expressions.cc
@@ -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();
}