mirror of
https://github.com/golang/go
synced 2024-11-06 03:16:10 -07:00
a265c2c448
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>
24 lines
520 B
Go
24 lines
520 B
Go
// Copyright 2014 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package main
|
|
|
|
// Test that the struct field in anonunion.go was promoted.
|
|
var v1 T
|
|
var v2 = v1.L
|
|
|
|
// Test that P, Q, and R all point to byte.
|
|
var v3 = Issue8478{P: (*byte)(nil), Q: (**byte)(nil), R: (***byte)(nil)}
|
|
|
|
// Test that N, A and B are fully defined
|
|
var v4 = N{}
|
|
var v5 = A{}
|
|
var v6 = B{}
|
|
|
|
// Test that S is fully defined
|
|
var v7 = S{}
|
|
|
|
func main() {
|
|
}
|