spec: unclear whether error should be reported for non-comparable switch expression in empty switch #43200
Comments
Change https://golang.org/cl/278132 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
Dec 15, 2020
…d (but empty) expr switch Enable one more errorcheck test. Updates #43110. Updates #43200. Change-Id: Ib7b971d5e9989c65320579f75d65266bbbbeec53 Reviewed-on: https://go-review.googlesource.com/c/go/+/278132 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Robert Findley <rfindley@google.com>
cc: @ianlancetaylor for input on what |
gccgo says
So the message needs a little work but it has the same behavior. |
Change https://golang.org/cl/278452 mentions this issue: |
gopherbot
pushed a commit
to golang/gofrontend
that referenced
this issue
Dec 15, 2020
For golang/go#43200 Change-Id: I7f102bfdd5a2578e59292be4c84e11df107f65c6 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/278452 Trust: Ian Lance Taylor <iant@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
sebhub
pushed a commit
to RTEMS/gnu-mirror-gcc
that referenced
this issue
Dec 16, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For:
the compiler reports an error:
Since there's no
case
in theswitch
statement, this might be considered ok. The spec is not explicitly stating that this is invalid.See also #43110.
The text was updated successfully, but these errors were encountered: