mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: recognize untyped constants defined in different files
An untyped constant can be defined in any input file, we shouldn't segregate them by file. Updates #28772 Change-Id: I0347f15236833bb511eb49f86c449ee9241b0a25 Reviewed-on: https://go-review.googlesource.com/c/151600 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Andrew Bonventre <andybons@golang.org>
This commit is contained in:
parent
048580d341
commit
4f26f24d2a
5 changed files with 18 additions and 5 deletions
|
|
@ -1233,7 +1233,7 @@ func (p *Package) isConst(f *File, x ast.Expr) bool {
|
|||
strings.HasPrefix(x.Name, "_Ciconst_") ||
|
||||
strings.HasPrefix(x.Name, "_Cfconst_") ||
|
||||
strings.HasPrefix(x.Name, "_Csconst_") ||
|
||||
f.Consts[x.Name]
|
||||
consts[x.Name]
|
||||
case *ast.UnaryExpr:
|
||||
return p.isConst(f, x.X)
|
||||
case *ast.BinaryExpr:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue