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

gccgo: accepts program with invalid identifier #11535

Closed
dvyukov opened this issue Jul 2, 2015 · 2 comments
Closed

gccgo: accepts program with invalid identifier #11535

dvyukov opened this issue Jul 2, 2015 · 2 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Jul 2, 2015

gccgo successfully compiles the following program:

package n
func _(t)

while gc and go/types say:

go.go:2: undefined: t
go.go:2:8: undeclared name: t

gccgo must reject this program.

gcc version 6.0.0 2015070 (experimental) (GCC)

@dvyukov
Copy link
Member Author

dvyukov commented Jul 2, 2015

@paranoiacblack

@ianlancetaylor ianlancetaylor added this to the Gccgo milestone Jul 10, 2015
@gopherbot
Copy link
Contributor

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

vries pushed a commit to vries/gcc that referenced this issue Aug 25, 2015
    
    When a function is declared and named with the blank identifier, only
    the syntax is checked.  This patch modifies the parser to add a dummy
    node for each function declaration with a blank identifier name that
    will be type checked like any function declaration.
    
    Fixes golang/go#11535.
    
    Reviewed-on: https://go-review.googlesource.com/13792


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@227160 138bc75d-0d04-0410-961f-82ee72b054a4
@golang golang locked and limited conversation to collaborators Aug 24, 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

3 participants