1
0
mirror of https://github.com/golang/go synced 2024-11-26 17:56:55 -07:00
go/misc/cgo
Rémy Oudompheng 711ea1e716 cmd/cgo: simplify and fix handling of untyped constants
Instead of trying to guess type of constants in the AST,
which is hard, use the "var cgo%d Type = Constant"
so that typechecking is left to the Go compiler.

The previous code could still fail in some cases
for constants imported from other modules
or defined in other, non-cgo files.

Fixes #30527

Change-Id: I2120cd90e90a74b9d765eeec53f6a3d2cfc1b642
Reviewed-on: https://go-review.googlesource.com/c/go/+/164897
Run-TryBot: Emmanuel Odeke <emm.odeke@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
2019-03-06 21:16:20 +00:00
..
errors misc/cgo/errors: fix tests in module mode 2019-02-22 17:24:25 +00:00
fortran *.bash: always use the same string equality operator 2017-03-14 21:46:31 +00:00
gmp
life misc/cgo: skip cgotest.TestCrossPackageTests on iOS and set PWD 2019-02-26 13:29:07 +00:00
nocgo
stdio misc/cgo: skip cgotest.TestCrossPackageTests on iOS and set PWD 2019-02-26 13:29:07 +00:00
test cmd/cgo: simplify and fix handling of untyped constants 2019-03-06 21:16:20 +00:00
testasan
testcarchive misc/cgo: skip cgotest.TestCrossPackageTests on iOS and set PWD 2019-02-26 13:29:07 +00:00
testcshared misc/cgo/testcshared: delete temporary directory in test 2019-03-01 21:33:00 +00:00
testgodefs misc/cgo/testgodefs: move source files into testdata 2019-02-26 02:44:12 +00:00
testplugin misc/cgo/testplugin: let TestMain run deferred functions 2019-03-01 21:33:27 +00:00
testsanitizers misc/cgo/testsanitizers: move test source files into testdata directory 2019-02-22 21:58:00 +00:00
testshared misc/cgo: skip cgotest.TestCrossPackageTests on iOS and set PWD 2019-02-26 13:29:07 +00:00
testsigfwd misc/cgo/testsigfwd: add missing return statement 2016-08-30 21:44:14 +00:00
testso misc/cgo/testso{,var}: fix tests in module mode 2019-02-26 02:43:55 +00:00
testsovar misc/cgo/testso{,var}: fix tests in module mode 2019-02-26 02:43:55 +00:00
testtls