disallow unknown-length pointer to opaque

This also means that translate-c has to detect when a pointer to
opaque is happening, and use `*` instead of `[*]`.

See #1059
This commit is contained in:
Andrew Kelley
2018-06-05 18:03:21 -04:00
parent 7a09482536
commit 652f4bdf62
14 changed files with 89 additions and 50 deletions

View File

@@ -1,6 +1,13 @@
const tests = @import("tests.zig");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.add(
"unknown length pointer to opaque",
\\export const T = [*]@OpaqueType();
,
".tmp_source.zig:1:18: error: unknown-length pointer to opaque",
);
cases.add(
"error when evaluating return type",
\\const Foo = struct {