1
0
mirror of https://github.com/golang/go synced 2024-11-23 11:50:09 -07:00
go/misc/cgo/test/issue28545.go
Ian Lance Taylor 4d567310d2 cmd/cgo: accept expressions as untyped constants
Fixes #28545

Change-Id: I31c57ce11aca651cacc72235c7753e0c0fd170ef
Reviewed-on: https://go-review.googlesource.com/c/146900
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
2018-11-02 19:28:58 +00:00

21 lines
482 B
Go

// Copyright 2018 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.
// Failed to add type conversion for negative constant.
// No runtime test; just make sure it compiles.
package cgotest
/*
#include <complex.h>
static void issue28545F(char **p, int n, complex double a) {}
*/
import "C"
func issue28545G(p **C.char) {
C.issue28545F(p, -1, (0))
C.issue28545F(p, 2+3, complex(1, 1))
}