This patch to the Go frontend improves the error message reported for
mixed named and unnamed parameters.  This requires updating a test in
the testsuite to the current version in the source repo.  Bootstrapped
and ran Go testsuite on x86_64-pc-linux-gnu.  Committed to mainline.

Ian
ed281e4a944a8b62e66d160b0910bd2be9ef9330
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 8cba9aa5a3d..d6ee8573e92 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@
-81d3afed2b7f7eba4eed4599dfdd10081f67391e
+720b8fed93143f284ca04358e1b13c8a3487281e
 
 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 b062a471008..00ac2f8f48c 100644
--- a/gcc/go/gofrontend/parse.cc
+++ b/gcc/go/gofrontend/parse.cc
@@ -995,7 +995,7 @@ Parse::parameter_list(bool* is_varargs)
     }
   if (mix_error)
     {
-      go_error_at(location, "invalid named/anonymous mix");
+      go_error_at(location, "mixed named and unnamed function parameters");
       saw_error = true;
     }
   if (saw_error)
diff --git a/gcc/testsuite/go.test/test/fixedbugs/bug388.go 
b/gcc/testsuite/go.test/test/fixedbugs/bug388.go
index d41f9ea543c..2d508501e07 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/bug388.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/bug388.go
@@ -1,6 +1,6 @@
 // errorcheck
 
-// Copyright 2011 The Go Authors.  All rights reserved.
+// Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -9,12 +9,12 @@
 package main
 import "runtime"
 
-func foo(runtime.UintType, i int) {  // ERROR "cannot declare name 
runtime.UintType|named/anonymous mix|undefined identifier"
+func foo(runtime.UintType, i int) {  // ERROR "cannot declare name 
runtime.UintType|mixed named and unnamed|undefined identifier"
        println(i, runtime.UintType) // GCCGO_ERROR "undefined identifier"
 }
 
 func bar(i int) {
-       runtime.UintType := i       // ERROR "cannot declare name 
runtime.UintType|non-name on left side|undefined identifier"
+       runtime.UintType := i       // ERROR "non-name 
runtime.UintType|non-name on left side|undefined identifier"
        println(runtime.UintType)       // GCCGO_ERROR "invalid use of 
type|undefined identifier"
 }
 

Reply via email to