Index: gcc/go/gofrontend/parse.cc =================================================================== --- gcc/go/gofrontend/parse.cc (revision 216343) +++ gcc/go/gofrontend/parse.cc (working copy) @@ -1253,6 +1253,8 @@ Parse::method_spec(Typed_identifier_list if (this->advance_token()->is_op(OPERATOR_LPAREN)) { // This is a MethodName. + if (name == "_") + error_at(this->location(), "methods must have a unique non-blank name"); name = this->gogo_->pack_hidden_name(name, is_exported); Type* type = this->signature(NULL, location); if (type == NULL) Index: gcc/testsuite/go.test/test/interface/explicit.go =================================================================== --- gcc/testsuite/go.test/test/interface/explicit.go (revision 216257) +++ gcc/testsuite/go.test/test/interface/explicit.go (working copy) @@ -83,12 +83,12 @@ var m4 = M(jj) // ERROR "invalid|wrong t type B1 interface { - _() + _() // ERROR "methods must have a unique non-blank name" } type B2 interface { M() - _() + _() // ERROR "methods must have a unique non-blank name" } type T2 struct{} Index: gcc/testsuite/go.test/test/interface/fail.go =================================================================== --- gcc/testsuite/go.test/test/interface/fail.go (revision 216257) +++ gcc/testsuite/go.test/test/interface/fail.go (working copy) @@ -14,7 +14,6 @@ type I interface { func main() { shouldPanic(p1) - shouldPanic(p2) } func p1() { @@ -30,19 +29,6 @@ type S struct{} func (s *S) _() {} -type B interface { - _() -} - -func p2() { - var s *S - var b B - var e interface{} - e = s - b = e.(B) - _ = b -} - func shouldPanic(f func()) { defer func() { if recover() == nil {