Sema: emit error when pointer to extern function is called
This commit is contained in:
16
test/cases/compile_errors/invalid_extern_function_call.zig
Normal file
16
test/cases/compile_errors/invalid_extern_function_call.zig
Normal file
@@ -0,0 +1,16 @@
|
||||
const x = @extern(*const fn() callconv(.C) void, .{ .name = "foo" });
|
||||
|
||||
pub fn entry0() void {
|
||||
comptime x();
|
||||
}
|
||||
|
||||
pub fn entry1() void {
|
||||
@call(.always_inline, x, .{});
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :4:15: error: comptime call of extern function pointer
|
||||
// :8:5: error: inline call of extern function pointer
|
||||
Reference in New Issue
Block a user