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: fails to parse (<-c) in select statement #20923

Closed
ianlancetaylor opened this issue Jul 6, 2017 · 2 comments
Closed

gccgo: fails to parse (<-c) in select statement #20923

ianlancetaylor opened this issue Jul 6, 2017 · 2 comments
Milestone

Comments

@ianlancetaylor
Copy link
Contributor

This fails to compile with current gccgo:

package p

func F(c chan bool) {
	select {
	case _, _ = (<-c):
	default:
	}
}
foo.go:5:14: error: missing ‘<-’
  case _, _ = (<-c):
              ^
foo.go:5:14: error: expected colon
foo.go:5:19: error: expected ‘;’ or ‘}’ or newline
  case _, _ = (<-c):
                   ^

The _, _ isn't needed, case (<-c): also fails to compile.

@ianlancetaylor ianlancetaylor added this to the Gccgo milestone Jul 6, 2017
@ianlancetaylor ianlancetaylor self-assigned this Jul 6, 2017
@gopherbot
Copy link

Change https://golang.org/cl/91657 mentions this issue: test: add a test that gccgo miscompiled

@gopherbot
Copy link

Change https://golang.org/cl/91695 mentions this issue: compiler: correct parse of parenthesized select case

hubot pushed a commit to gcc-mirror/gcc that referenced this issue Feb 5, 2018
    
    We used to mishandle `select { case (<-c): }` and friends.
    
    The test case for this is https://golang.org/cl/91657.
    
    Fixes golang/go#20923
    
    Reviewed-on: https://go-review.googlesource.com/91695


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@257374 138bc75d-0d04-0410-961f-82ee72b054a4
gopherbot pushed a commit that referenced this issue Feb 14, 2018
Updates #20923

Change-Id: Ia1210ea3dec39e5db2521aeafca24d6e731f0c93
Reviewed-on: https://go-review.googlesource.com/91657
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
@golang golang locked and limited conversation to collaborators Feb 5, 2019
asiekierka pushed a commit to WonderfulToolchain/gcc-ia16 that referenced this issue May 16, 2022
    
    We used to mishandle `select { case (<-c): }` and friends.
    
    The test case for this is https://golang.org/cl/91657.
    
    Fixes golang/go#20923
    
    Reviewed-on: https://go-review.googlesource.com/91695

From-SVN: r257374
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

2 participants