From 3d92dd60033c312e3ae7cac319c792271cf67e37 Mon Sep 17 00:00:00 2001 From: Alan Donovan Date: Wed, 7 Dec 2016 10:57:27 -0500 Subject: [PATCH] go/internal/gccgoimporter: handle conversions in exported const values Same as https://go-review.googlesource.com/c/33412/ in the standard library. Fixes #17981. Change-Id: Iaf47872840a4456d824ed5d7b3eda205c043e4cf Reviewed-on: https://go-review.googlesource.com/34110 Reviewed-by: Robert Griesemer --- go/internal/gccgoimporter/importer.go | 5 ++- go/internal/gccgoimporter/importer_test.go | 1 + go/internal/gccgoimporter/parser.go | 40 +++++++++++++++---- .../gccgoimporter/testdata/conversions.go | 5 +++ .../gccgoimporter/testdata/conversions.gox | 6 +++ 5 files changed, 48 insertions(+), 9 deletions(-) create mode 100644 go/internal/gccgoimporter/testdata/conversions.go create mode 100644 go/internal/gccgoimporter/testdata/conversions.gox diff --git a/go/internal/gccgoimporter/importer.go b/go/internal/gccgoimporter/importer.go index 7b394d24cf0..a3fae9aa524 100644 --- a/go/internal/gccgoimporter/importer.go +++ b/go/internal/gccgoimporter/importer.go @@ -65,6 +65,7 @@ func findExportFile(searchpaths []string, pkgpath string) (string, error) { const ( gccgov1Magic = "v1;\n" + gccgov2Magic = "v2;\n" goimporterMagic = "\n$$ " archiveMagic = "!> = convert(, "bits"); +type ;