-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/cgo: accept expressions as untyped constants
Fixes golang#28545 Change-Id: I31c57ce11aca651cacc72235c7753e0c0fd170ef Reviewed-on: https://go-review.googlesource.com/c/146900 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
- Loading branch information
1 parent
745ec8b
commit 4d56731
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// 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)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters