diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-10-12 19:01:50 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2017-10-12 19:01:50 +0000 |
commit | 1baafc8d197217a11085f48a93ccd23dc59d2edb (patch) | |
tree | c2067c15d57d55a695703b5ea06cbd914fd9d211 | |
parent | d89dac3602ea7fa8b29d55fb6f945181fb16f427 (diff) | |
download | gcc-1baafc8d197217a11085f48a93ccd23dc59d2edb.zip gcc-1baafc8d197217a11085f48a93ccd23dc59d2edb.tar.gz gcc-1baafc8d197217a11085f48a93ccd23dc59d2edb.tar.bz2 |
compiler: fix import of indirectly imported type alias
We were looking for the " = " before the optional package name that
appears for an indirect reference, but the exporter was putting it
after.
Test is https://golang.org/cl/70290.
Reviewed-on: https://go-review.googlesource.com/70330
From-SVN: r253694
-rw-r--r-- | gcc/go/gofrontend/MERGE | 2 | ||||
-rw-r--r-- | gcc/go/gofrontend/import.cc | 14 |
2 files changed, 8 insertions, 8 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index 41f809f..418e127 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -af46ad16dc34773877068393d331ac8ae34b2219 +44132970e4b6c1186036bf8eda8982fb6e905d6f The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/import.cc b/gcc/go/gofrontend/import.cc index 20b077f..2a3ea83 100644 --- a/gcc/go/gofrontend/import.cc +++ b/gcc/go/gofrontend/import.cc @@ -756,13 +756,6 @@ Import::read_type() this->require_c_string(" "); - bool is_alias = false; - if (this->match_c_string("= ")) - { - stream->advance(2); - is_alias = true; - } - // The package name may follow. This is the name of the package in // the package clause of that package. The type name will include // the pkgpath, which may be different. @@ -775,6 +768,13 @@ Import::read_type() this->require_c_string(" "); } + bool is_alias = false; + if (this->match_c_string("= ")) + { + stream->advance(2); + is_alias = true; + } + // Declare the type in the appropriate package. If we haven't seen // it before, mark it as invisible. We declare it before we read // the actual definition of the type, since the definition may refer |