diff options
| author | Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com> | 2023-11-05 13:36:06 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-05 12:36:06 +0200 |
| commit | e9a6197a8ea38c228e2683d82cfbdbad8e7d912a (patch) | |
| tree | a35378edac7d399d7752e987b3cd55806e391666 /test/cases/compile_errors | |
| parent | 33644546a0c17e48f0a3f7b59d9bd0a749666173 (diff) | |
| download | zig-e9a6197a8ea38c228e2683d82cfbdbad8e7d912a.tar.gz zig-e9a6197a8ea38c228e2683d82cfbdbad8e7d912a.zip | |
Sema: fix error notes with wrong extern type
Diffstat (limited to 'test/cases/compile_errors')
| -rw-r--r-- | test/cases/compile_errors/extern_function_with_unspecified_calling_convention.zig | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/cases/compile_errors/extern_function_with_unspecified_calling_convention.zig b/test/cases/compile_errors/extern_function_with_unspecified_calling_convention.zig new file mode 100644 index 0000000000..ead75eb43e --- /dev/null +++ b/test/cases/compile_errors/extern_function_with_unspecified_calling_convention.zig @@ -0,0 +1,14 @@ +const Foo = extern struct { + f: *const fn() void, +}; + +pub fn entry() void { + _ = (Foo{}).f; +} + +// error +// backend=stage2 +// target=native +// +// :2:8: error: extern structs cannot contain fields of type '*const fn () void' +// :2:8: note: extern function must specify calling convention |
