aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/parse.cc14
2 files changed, 14 insertions, 2 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 853cb4a..e499d7f 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-cc7303c97b232ea979cab950d95aaf76c4e0f5b5
+81810917af7ba19e1f9f8efc8b1989f7d6419d30
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc
index 211fd73..922473a 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -2305,8 +2305,20 @@ Parse::function_decl(bool saw_nointerface)
if (!this->peek_token()->is_op(OPERATOR_LCURLY))
{
- if (named_object == NULL && !Gogo::is_sink_name(name))
+ if (named_object == NULL)
{
+ // Function declarations with the blank identifier as a name are
+ // mostly ignored since they cannot be called. We make an object
+ // for this declaration for type-checking purposes.
+ if (Gogo::is_sink_name(name))
+ {
+ static int count;
+ char buf[30];
+ snprintf(buf, sizeof buf, ".$sinkfndecl%d", count);
+ ++count;
+ name = std::string(buf);
+ }
+
if (fntype == NULL
|| (expected_receiver && rec == NULL))
this->gogo_->add_erroneous_name(name);