Commit 107744e9 authored by Bryan C. Mills's avatar Bryan C. Mills Committed by Bryan Mills

misc/cgo/errors: test that the Go rune type is not identical to C.int

rune has a well-defined size, but C.int is implementation-specified.
Using one as the other should require an explicit conversion.

updates #13467

Change-Id: I53ab2478427dca790efdcc197f6b8d9fbfbd1847
Reviewed-on: https://go-review.googlesource.com/63730Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent 814d9223
...@@ -114,6 +114,7 @@ func TestReportsTypeErrors(t *testing.T) { ...@@ -114,6 +114,7 @@ func TestReportsTypeErrors(t *testing.T) {
"issue11097b.go", "issue11097b.go",
"issue13129.go", "issue13129.go",
"issue13423.go", "issue13423.go",
"issue13467.go",
"issue13635.go", "issue13635.go",
"issue13830.go", "issue13830.go",
"issue16116.go", "issue16116.go",
......
// Copyright 2017 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 p
/*
static int transform(int x) { return x; }
*/
import "C"
func F() {
var x rune = '✈'
var _ rune = C.transform(x) // ERROR HERE: C\.int
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment