cmd/go: reports errors for a correct preamble when it contains a builtin C type and a C.*
name can't be resolved
#50710
Labels
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
==foo.go==
go tool cgo foo.go
What did you expect to see?
Only this error message:
foo.go:10:14: could not determine kind of name for C.StrLen1
What did you see instead?
I saw the previous error and a preamble error, when the preamble is perfectly fine.
_GoString_
is defined in the buildin prolog but we are not adding the prolog to the preamble when checking if the preamble has any error:go/src/cmd/cgo/gcc.go
Lines 492 to 495 in e7d5857
The text was updated successfully, but these errors were encountered: