From 5c185649422b316a961e76187622ae929ecf4908 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Tue, 12 Aug 2014 12:55:12 -0700 Subject: cmd/cgo: make C function pointers non-assignable Fixes issue 7757. Fixes issue 8488. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/118690044 Committer: Ian Lance Taylor --- misc/cgo/errors/issue7757.go | 14 ++++++++++++++ misc/cgo/errors/test.bash | 1 + 2 files changed, 15 insertions(+) create mode 100644 misc/cgo/errors/issue7757.go (limited to 'misc/cgo') diff --git a/misc/cgo/errors/issue7757.go b/misc/cgo/errors/issue7757.go new file mode 100644 index 000000000..5eafd22e8 --- /dev/null +++ b/misc/cgo/errors/issue7757.go @@ -0,0 +1,14 @@ +// 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 + +/* +void foo() {} +*/ +import "C" + +func main() { + C.foo = C.foo // ERROR HERE +} diff --git a/misc/cgo/errors/test.bash b/misc/cgo/errors/test.bash index f0f60c844..e5bf47a0d 100755 --- a/misc/cgo/errors/test.bash +++ b/misc/cgo/errors/test.bash @@ -27,6 +27,7 @@ check() { check err1.go check err2.go check err3.go +check issue7757.go rm -rf errs _obj exit 0 -- cgit v1.2.1