Skip to content

gccgo: compilation failure for example with non-ASCII package #27836

Closed
@thanm

Description

@thanm

Please answer these questions before submitting your issue. Thanks!

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

gccgo tip
go version go1.10.3 gccgo (GCC) 9.0.0 20180920 (experimental) linux/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

Unpack tar file tarfile.gz
in your $GOPATH, change dir to Äbar, then build.

What did you expect to see?

Clean build

What did you see instead?

$ tar xzvf - < tarfile.gz
./Äbar/
./Äbar/Äbar.go
./Äfoo/
./Äfoo/Äfoo.go
$ cd ./Äbar/
$ go build -compiler gccgo .
$ go build -compiler gccgo  .
# Äbar
./Äbar.go:5:7: error: imported and not used: Äfoo
5 |  "Äfoo"
  |       ^
./Äbar.go:9:45: error: reference to undefined name ‘Äfoo’
9 |  fmt.Printf("Äfoo.Äbar(33) returns %v\n", Äfoo.Äbar(33))
  |                                             ^
$

This program builds cleanly with the regular Go compiler.

I need to spend more time in the debugger, but I think this is a parsing issue, since it is happening very early in the compilation. The call to Äfoo.Äbar is somehow not getting tracked as a reference to the Äfoo package, hence the incorrect error. More investigation needed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions