]> Cypherpunks repositories - gostls13.git/commit
cmd/cgo, misc/cgo: only cache anonymous struct typedefs with parent name
authorTobias Klauser <tklauser@distanz.ch>
Sun, 29 Mar 2020 22:38:09 +0000 (00:38 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Mon, 30 Mar 2020 18:44:17 +0000 (18:44 +0000)
commita265c2c448497fcee1633d2e2b912da52ea22d3c
tree9be12ed6eeb6259f3856ac2b76530ef13b348a59
parent3ee782b11da3fb0313603ad0e3be8ab6755802a9
cmd/cgo, misc/cgo: only cache anonymous struct typedefs with parent name

CL 181857 broke the translation of certain C types using cmd/cgo -godefs
because it stores each typedef, array and qualified type with their
parent type name in the translation cache.

Fix this by only considering the parent type for typedefs of anonymous
structs which is the only case where types might become ambiguous.

Updates #31891
Fixes #37479
Fixes #37621

Change-Id: I301a749ec89585789cb0d213593bb8b7341beb88
Reviewed-on: https://go-review.googlesource.com/c/go/+/226341
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
misc/cgo/testgodefs/testdata/issue37479.go [new file with mode: 0644]
misc/cgo/testgodefs/testdata/issue37621.go [new file with mode: 0644]
misc/cgo/testgodefs/testdata/main.go
misc/cgo/testgodefs/testgodefs_test.go
src/cmd/cgo/gcc.go