From ba1a65fc518c367bd4a3e18324036d457e6a07c3 Mon Sep 17 00:00:00 2001 From: Hiroshi Ioka Date: Thu, 2 Feb 2017 21:53:52 +0900 Subject: [PATCH] cmd/cgo: don't track same node twice in guessKinds Change-Id: Ib2c1490a42e3485913a05a0b2fecdcc425d42871 Reviewed-on: https://go-review.googlesource.com/36083 Run-TryBot: Ian Lance Taylor TryBot-Result: Gobot Gobot Reviewed-by: Ian Lance Taylor --- src/cmd/cgo/gcc.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index 5ea2d941ca..a740748d2f 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -269,11 +269,10 @@ func (p *Package) guessKinds(f *File) []*Name { } } - needType = append(needType, n) - // If this is a struct, union, or enum type name, no need to guess the kind. if strings.HasPrefix(n.C, "struct ") || strings.HasPrefix(n.C, "union ") || strings.HasPrefix(n.C, "enum ") { n.Kind = "type" + needType = append(needType, n) continue } -- 2.48.1