This is the mail archive of the
gcc-cvs@gcc.gnu.org
mailing list for the GCC project.
r248081 - in /trunk/gcc/go/gofrontend: MERGE go...
- From: ian at gcc dot gnu dot org
- To: gcc-cvs at gcc dot gnu dot org
- Date: Tue, 16 May 2017 00:02:03 -0000
- Subject: r248081 - in /trunk/gcc/go/gofrontend: MERGE go...
Author: ian
Date: Tue May 16 00:02:03 2017
New Revision: 248081
URL: https://gcc.gnu.org/viewcvs?rev=248081&root=gcc&view=rev
Log:
compiler: report correct errors for sink methods
If somebody writes
func (s []int) _() {}
we should report an error. Before this patch we were silently
accepting this code, because we didn't report any errors about the
receiver if the method was a sink.
This patch is unfortunately slightly complex to handle the case of
func (x int) _() {}
which we can only detect after define_global_names.
This fixes blank1.go in the current gc testsuite.
Reviewed-on: https://go-review.googlesource.com/43456
Modified:
trunk/gcc/go/gofrontend/MERGE
trunk/gcc/go/gofrontend/gogo.cc
trunk/gcc/go/gofrontend/gogo.h
trunk/gcc/go/gofrontend/types.cc
trunk/gcc/go/gofrontend/types.h