https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71396
Bug ID: 71396 Summary: "use of undefined type" error in gccgo-6 when go (1.6.1) is perfectly happy Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: go Assignee: ian at airs dot com Reporter: mvo at debian dot org CC: cmang at google dot com Target Milestone: --- Created attachment 38633 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=38633&action=edit Minimal testcase We had a build failure in our go code with gccgo-6 (from Ubuntu 16.04: $ gccgo-6 --version gccgo-6 (Ubuntu 6.0.1-0ubuntu1) 6.0.0 20160414 (experimental) [trunk revision 234994], same error with gccgo-5 fwiw): """ ok github.com/snapcore/snapd/arch 0.159s # github.com/snapcore/snapd/snap_test src/github.com/snapcore/snapd/snap/info_test.go:60:3: error: use of undefined type ‘Revision’ Revision: snap.R(1), ^ """ (https://launchpadlibrarian.net/262885164/buildlog_ubuntu-yakkety-powerpc.snapd_2.0.6+16.10.2_BUILDING.txt.gz) I tracked this down and condensed it into some minimal example go code (attached). The issue is triggered by the "revision_test.go" import of ".". If that is removed the tests work fine again. With the attached testcase I get the following: """ $ go test && go-6 test 1 {{7}} PASS ok _/tmp/2 0.001s # _/tmp/2_test ./foo_test.go:11:3: error: use of undefined type ‘Revision’ Revision: foo.R(1), ^ FAIL _/tmp/2 [build failed] """ I.e. go test is happy, gccgo-6 is unhappy (with a error message that confused me quite a bit :) I hope this is useful for you. It's fine if the answer to this bugreport is: "don't do this if it fails". However given that I already tracked it down I felt I might as well share it with you. Cheers, Michael