Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/compile: cannot take address of a struct literal #13261

Closed
dvyukov opened this issue Nov 16, 2015 · 2 comments
Closed

cmd/compile: cannot take address of a struct literal #13261

dvyukov opened this issue Nov 16, 2015 · 2 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Nov 16, 2015

cmd/compile rejects to compile to following correct program:

package main

func main() {
    switch &(struct{}{}) {
    }
}
./1.go:6: cannot take the address of struct {} literal

gotype and -oldparser eat it.

go version devel +25a28da Sun Nov 15 23:41:28 2015 +0000 linux/amd64

Found with GoSmith (https://github.com/dvyukov/gosmith).

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Nov 16, 2015
@griesemer
Copy link
Contributor

Started.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/17040 mentions this issue.

@golang golang locked and limited conversation to collaborators Nov 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants