zig/test/cases/compile_errors/invalid_variadic_function.zig
Tw d7b93c7876 Sema: make source location in checkCallConvSupportsVarArgs more meaningful
As calling convention may not be specified explicitly in the source,
so use va_arg's location instead.

Signed-off-by: Tw <tw19881113@gmail.com>
2025-02-17 05:28:11 +01:00

17 lines
444 B
Zig

fn foo(...) void {}
inline fn foo2(...) void {}
comptime {
_ = foo;
}
comptime {
_ = foo2;
}
// error
// target=x86_64-linux
//
// :1:8: error: variadic function does not support 'auto' calling convention
// :1:8: note: supported calling conventions: 'x86_64_sysv', 'x86_64_win'
// :2:16: error: variadic function does not support 'inline' calling convention
// :2:16: note: supported calling conventions: 'x86_64_sysv', 'x86_64_win'