aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-02-14 23:09:12 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-02-14 23:09:31 -0500
commitd6e0d82c328b4f9d733364382cce0941a601e91a (patch)
treeba5848ece64d705fa436fa4924b8e59a1a9a3dce /test/compile_errors.zig
parentd5bbd748711abc82272199869cf70faf1ea30f52 (diff)
downloadzig-d6e0d82c328b4f9d733364382cce0941a601e91a.tar.gz
zig-d6e0d82c328b4f9d733364382cce0941a601e91a.zip
translate-c: back to *c_void for opaque types
See #1059
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index a2fd901197..1f641a9052 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -2,6 +2,16 @@ const tests = @import("tests.zig");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.addTest(
+ "C pointer to c_void",
+ \\export fn a() void {
+ \\ var x: *c_void = undefined;
+ \\ var y: [*c]c_void = x;
+ \\}
+ ,
+ ".tmp_source.zig:3:12: error: C pointers cannot point opaque types",
+ );
+
+ cases.addTest(
"directly embedding opaque type in struct and union",
\\const O = @OpaqueType();
\\const Foo = struct {