mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/cgo: also rewrite C.var in selector expressions
While we're here, rename TestIssue7234 to Test7234 for consistency with other tests. Fixes #9557. Change-Id: I22b0a212b31e7b4f199f6a70deb73374beb80f84 Reviewed-on: https://go-review.googlesource.com/2654 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
a6cb053026
commit
16993f2485
4 changed files with 45 additions and 1 deletions
|
|
@ -659,6 +659,13 @@ func (p *Package) rewriteRef(f *File) {
|
|||
expr = &ast.StarExpr{Star: (*r.Expr).Pos(), X: expr}
|
||||
}
|
||||
|
||||
case "selector":
|
||||
if r.Name.Kind == "var" {
|
||||
expr = &ast.StarExpr{Star: (*r.Expr).Pos(), X: expr}
|
||||
} else {
|
||||
error_(r.Pos(), "only C variables allowed in selector expression", fixGo(r.Name.Go))
|
||||
}
|
||||
|
||||
case "type":
|
||||
if r.Name.Kind != "type" {
|
||||
error_(r.Pos(), "expression C.%s used as type", fixGo(r.Name.Go))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue