zig/test/cases/compile_errors/invalid_variadic_function.zig
r00ster91 026c63d8fe Sema: infrastructure for supporting more than .C callconv for variadic functions
Now you can add new calling conventions that you confirmed to work with
variadic functions simply in a single place and the rest will work
automatically.
2023-07-08 18:05:03 -04:00

24 lines
539 B
Zig

fn foo(...) void {}
fn bar(a: anytype, ...) callconv(a) void {}
inline fn foo2(...) void {}
comptime {
_ = foo;
}
comptime {
_ = bar;
}
comptime {
_ = foo2;
}
// error
// backend=stage2
// target=native
//
// :1:1: error: variadic function does not support '.Unspecified' calling convention
// :1:1: note: supported calling conventions: '.C'
// :2:1: error: generic function cannot be variadic
// :1:1: error: variadic function does not support '.Inline' calling convention
// :1:1: note: supported calling conventions: '.C'