From: Ian Lance Taylor Date: Fri, 10 Sep 2010 05:40:25 +0000 (-0700) Subject: test: Match gccgo error messages. X-Git-Tag: weekly.2010-09-15~69 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=c30b570468973021b5d20f0baa28216ecf6be94c;p=gostls13.git test: Match gccgo error messages. With the recursive descent parser that gccgo uses, I think that it doesn't make sense to try to match a statement where a statement is not expected. If the construct is not a statement, you will just get bizarre error messages. topexpr.go:9:1: error: expected declaration topexpr.go:14:1: error: expected declaration topexpr.go:19:1: error: expected declaration R=rsc, r2 CC=golang-dev https://golang.org/cl/2175041 --- diff --git a/test/syntax/topexpr.go b/test/syntax/topexpr.go index 83de49075d..93d86fbe95 100644 --- a/test/syntax/topexpr.go +++ b/test/syntax/topexpr.go @@ -6,15 +6,15 @@ package main -fmt.Printf("hello") // ERROR "non-declaration statement outside function body" +fmt.Printf("hello") // ERROR "non-declaration statement outside function body|expected declaration" func main() { } -x++ // ERROR "non-declaration statement outside function body" +x++ // ERROR "non-declaration statement outside function body|expected declaration" func init() { } -x,y := 1, 2 // ERROR "non-declaration statement outside function body" +x,y := 1, 2 // ERROR "non-declaration statement outside function body|expected declaration"