]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: make forward declaration in pure Go package an error
authorRuss Cox <rsc@golang.org>
Sat, 22 Dec 2012 21:46:46 +0000 (16:46 -0500)
committerRuss Cox <rsc@golang.org>
Sat, 22 Dec 2012 21:46:46 +0000 (16:46 -0500)
commit04098d88fa1b4d41557ac6824a528d092d562936
tree544264759a837ea6f3c5daa3212f4c39f0b1e852
parent1b3244e0dbbe547a0703d0380708f480a8f3c228
cmd/gc: make forward declaration in pure Go package an error

An error during the compilation can be more precise
than an error at link time.

For 'func init', the error happens always: you can't forward
declare an init func because the name gets mangled.

For other funcs, the error happens only with the special
(and never used by hand) -= flag, which tells 6g the
package is pure go.

The go command now passes -= for pure Go packages.

Fixes #3705.

R=ken2
CC=golang-dev
https://golang.org/cl/6996054
doc/progs/error.go
src/cmd/gc/go.h
src/cmd/gc/lex.c
src/cmd/gc/pgen.c
src/cmd/go/build.go