aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/go.test/test
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2017-01-25 05:12:26 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2017-01-25 05:12:26 +0000
commit98e20758464f5cbfc60bd61a0cadd66ebb900d96 (patch)
treedc33fcfdbc083da77501abbf15d7d40655c1e3a0 /gcc/testsuite/go.test/test
parent49d4fa438eab8a98541846b0213f5d23752ba2b4 (diff)
downloadgcc-98e20758464f5cbfc60bd61a0cadd66ebb900d96.zip
gcc-98e20758464f5cbfc60bd61a0cadd66ebb900d96.tar.gz
gcc-98e20758464f5cbfc60bd61a0cadd66ebb900d96.tar.bz2
compiler: improvements for type alias handling
Give an error for an attempt to define a method on an imported type. Give an error for each attempt to define a method on a builtin type. Adjust error messages to be closer to gc error messages. With these changes gccgo passes current tests on dev.typealias branch. This changes the errors printed for test/fixedbugs/issue5089.go, but the change is an improvement: Before: fixedbugs/issue5089.go:13:1: error: redefinition of ‘bufio.Buffered’: receiver name changed func (b *bufio.Reader) Buffered() int { // ERROR "non-local|redefinition" ^ fixedbugs/issue5089.go:11:13: note: previous definition of ‘bufio.Buffered’ was here import "bufio" // GCCGO_ERROR "previous" ^ Now: fixedbugs/issue5089.go:13:7: error: may not define methods on non-local type func (b *bufio.Reader) Buffered() int { // ERROR "non-local|redefinition" ^ Reviewed-on: https://go-review.googlesource.com/35642 From-SVN: r244889
Diffstat (limited to 'gcc/testsuite/go.test/test')
-rw-r--r--gcc/testsuite/go.test/test/fixedbugs/issue5089.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/testsuite/go.test/test/fixedbugs/issue5089.go b/gcc/testsuite/go.test/test/fixedbugs/issue5089.go
index 81b9f05..dc393e9 100644
--- a/gcc/testsuite/go.test/test/fixedbugs/issue5089.go
+++ b/gcc/testsuite/go.test/test/fixedbugs/issue5089.go
@@ -1,6 +1,6 @@
// errorcheck
-// Copyright 2013 The Go Authors. All rights reserved.
+// Copyright 2013 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.
@@ -8,7 +8,7 @@
package p
-import "bufio" // GCCGO_ERROR "previous"
+import "bufio"
func (b *bufio.Reader) Buffered() int { // ERROR "non-local|redefinition"
return -1