]> Cypherpunks repositories - gostls13.git/commit
cmd/gc: reject non-Go constants
authorRuss Cox <rsc@golang.org>
Sat, 2 Feb 2013 04:10:02 +0000 (23:10 -0500)
committerRuss Cox <rsc@golang.org>
Sat, 2 Feb 2013 04:10:02 +0000 (23:10 -0500)
commit8931306389c5b9a19b9b90cc7e263782edcaf579
treefa0faf5f280aded75015df076f0ce70823d311a0
parentf607c479eabab497b3e7d3dead472a19bd27e063
cmd/gc: reject non-Go constants

Expressions involving nil, even if they can be evaluated
at compile time, do not count as Go constants and cannot
be used in const initializers.

Fixes #4673.
Fixes #4680.

R=ken2
CC=golang-dev
https://golang.org/cl/7278043
src/cmd/gc/const.c
src/cmd/gc/go.h
src/cmd/gc/subr.c
src/cmd/gc/typecheck.c
test/const1.go
test/const5.go
test/fixedbugs/bug297.go
test/fixedbugs/issue4097.go
test/fixedbugs/issue4654.go
test/run.go