blob: 7ce9e137035a4a679728f710b98d3129e96c1e9a [file] [log] [blame]
Russ Cox80803842012-02-16 23:49:59 -05001// errorcheck
Ryan Hitchmana15448d2012-01-06 14:34:16 -08002
3// Copyright 2011 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7// Issue 2627 -- unsafe.Pointer type isn't handled nicely in some errors
8
9package main
10
11import "unsafe"
12
13func main() {
14 var x *int
Ian Lance Taylord5b7c512012-01-26 23:06:47 -080015 _ = unsafe.Pointer(x) - unsafe.Pointer(x) // ERROR "operator - not defined on unsafe.Pointer|expected integer, floating, or complex type"
Ryan Hitchmana15448d2012-01-06 14:34:16 -080016}