diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/bugs/bug299.go | 27 | ||||
| -rw-r--r-- | test/fixedbugs/bug299.go | 27 | ||||
| -rw-r--r-- | test/fixedbugs/bug300.go (renamed from test/bugs/bug300.go) | 12 | ||||
| -rw-r--r-- | test/golden.out | 12 |
4 files changed, 33 insertions, 45 deletions
diff --git a/test/bugs/bug299.go b/test/bugs/bug299.go deleted file mode 100644 index d455540c65..0000000000 --- a/test/bugs/bug299.go +++ /dev/null @@ -1,27 +0,0 @@ -// errchk $G $D/$F.go - -// Copyright 2010 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. - -package main - -type T struct { - // accepted by both compilers, legal according to spec - x int - y (int) - int - *float - // not accepted by both compilers, not legal according to spec - (complex) // ERROR "non-declaration|expected" - (*string) // ERROR "non-declaration|expected" - *(bool) // ERROR "non-declaration|expected" -} - -// accepted by both compilers, legal according to spec -func (p T) m() {} - -// accepted by 6g, not accepted by gccgo, not legal according to spec -func (p (T)) f() {} // ERROR "expected" -func (p *(T)) g() {} // ERROR "expected" -func (p (*T)) h() {} // ERROR "expected" diff --git a/test/fixedbugs/bug299.go b/test/fixedbugs/bug299.go new file mode 100644 index 0000000000..1793a0de69 --- /dev/null +++ b/test/fixedbugs/bug299.go @@ -0,0 +1,27 @@ +// errchk $G $D/$F.go + +// Copyright 2010 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. + +package main + +type T struct { + // legal according to spec + x int + y (int) + int + *float + // not legal according to spec + (complex) // ERROR "non-declaration|expected|parenthesize" + (*string) // ERROR "non-declaration|expected|parenthesize" + *(bool) // ERROR "non-declaration|expected|parenthesize" +} + +// legal according to spec +func (p T) m() {} + +// not legal according to spec +func (p (T)) f() {} // ERROR "parenthesize" +func (p *(T)) g() {} // ERROR "parenthesize" +func (p (*T)) h() {} // ERROR "parenthesize" diff --git a/test/bugs/bug300.go b/test/fixedbugs/bug300.go index dbed509391..09ee3ab697 100644 --- a/test/bugs/bug300.go +++ b/test/fixedbugs/bug300.go @@ -20,10 +20,10 @@ func main() { _ = T{} // illegal composite literals: parentheses not allowed around literal type - _ = (struct{}){} // ERROR "xxx" - _ = ([42]int){} // ERROR "xxx" - _ = ([...]int){} // ERROR "xxx" - _ = ([]int){} // ERROR "xxx" - _ = (map[int]int){} // ERROR "xxx" - _ = (T){} // ERROR "xxx" + _ = (struct{}){} // ERROR "parenthesize" + _ = ([42]int){} // ERROR "parenthesize" + _ = ([...]int){} // ERROR "parenthesize" + _ = ([]int){} // ERROR "parenthesize" + _ = (map[int]int){} // ERROR "parenthesize" + _ = (T){} // ERROR "parenthesize" } diff --git a/test/golden.out b/test/golden.out index 5999db6616..49bca4b874 100644 --- a/test/golden.out +++ b/test/golden.out @@ -177,15 +177,3 @@ panic PC=xxx =========== bugs/bug260.go FAIL BUG: bug260 failed - -=========== bugs/bug299.go -BUG: errchk: bugs/bug299.go:25: missing expected error: 'expected' -errchk: bugs/bug299.go:26: missing expected error: 'expected' -errchk: bugs/bug299.go:27: missing expected error: 'expected' -errchk: bugs/bug299.go: unmatched error messages: -================================================== -bugs/bug299.go:19: syntax error: unexpected } -================================================== - -=========== bugs/bug300.go -BUG: errchk: command succeeded unexpectedly |
