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: "missing function body" detection stops working #48097

Closed
cherrymui opened this issue Aug 31, 2021 · 2 comments
Closed

cmd/compile: "missing function body" detection stops working #48097

cherrymui opened this issue Aug 31, 2021 · 2 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@cherrymui
Copy link
Member

What version of Go are you using (go version)?

tip (bdc1bef)

Does this issue reproduce with the latest release?

No.

What did you do?

Compiling the following code, with a bodyless function but not assembly file or linknames.

package p

func F()

What did you expect to see?

$ go1.17 build x.go
# command-line-arguments
./x.go:3:6: missing function body

What did you see instead?

$ go build x.go
$ go tool compile -complete x.go

No error for both commands. cmd/go does pass -complete to the compiler correctly, but the compiler doesn't detect the error.

cc @mdempsky @aclements @thanm

@cherrymui cherrymui added the NeedsFix The path to resolution is known, but the work has not been done. label Aug 31, 2021
@cherrymui cherrymui added this to the Go1.18 milestone Aug 31, 2021
@cuonglm
Copy link
Member

cuonglm commented Sep 1, 2021

This seems -G=3 issue, or specifically, irgen since when it also does not handle //go:noescape:

package p

func F()

//go:noescape
func f() {}

@cuonglm cuonglm self-assigned this Sep 1, 2021
@gopherbot
Copy link

Change https://golang.org/cl/346470 mentions this issue: cmd/compile: fix irgen mis-handling invalid function declaration

@rsc rsc unassigned cuonglm Jun 23, 2022
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants