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: does not recognize unused import #12326

Closed
dvyukov opened this issue Aug 25, 2015 · 2 comments
Closed

gccgo: does not recognize unused import #12326

dvyukov opened this issue Aug 25, 2015 · 2 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Aug 25, 2015

gccgo successfully compiles the following program:

package a
import  _ "fmt"
import "fmt"

Both gc and gotype say:

"fmt" imported but not used

They seem to be right.
gofrontend is on commit 81810917af7ba19e1f9f8efc8b1989f7d6419d30

@dvyukov
Copy link
Member Author

dvyukov commented Aug 25, 2015

@ianlancetaylor @griesemer

@ianlancetaylor ianlancetaylor added this to the Gccgo milestone Aug 25, 2015
@gopherbot
Copy link
Contributor

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

vries pushed a commit to vries/gcc that referenced this issue Oct 7, 2015
    
    This patch introduces the Package_alias class which is a
    finer representation of the different between a package and the
    aliases it is imported under.  Each alias keeps track of the location
    of its import statement and how many times that alias has been used.
    This allows the gofrontend to report when a specific import has not
    been used even if a symbol from the package has been used by another
    import.
    
    Fixes golang/go#12326.
    
    Reviewed-on: https://go-review.googlesource.com/14259


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228550 138bc75d-0d04-0410-961f-82ee72b054a4
@golang golang locked and limited conversation to collaborators Oct 9, 2016
asiekierka pushed a commit to WonderfulToolchain/gcc-ia16 that referenced this issue May 16, 2022
    
    This patch introduces the Package_alias class which is a
    finer representation of the different between a package and the
    aliases it is imported under.  Each alias keeps track of the location
    of its import statement and how many times that alias has been used.
    This allows the gofrontend to report when a specific import has not
    been used even if a symbol from the package has been used by another
    import.
    
    Fixes golang/go#12326.
    
    Reviewed-on: https://go-review.googlesource.com/14259

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

4 participants