mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 14:25:16 +00:00
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>
This commit is contained in:
parent
86064e66d6
commit
d7b93c7876
@ -9669,7 +9669,13 @@ fn funcCommon(
|
||||
if (is_generic) {
|
||||
return sema.fail(block, func_src, "generic function cannot be variadic", .{});
|
||||
}
|
||||
try sema.checkCallConvSupportsVarArgs(block, cc_src, cc);
|
||||
const va_args_src = block.src(.{
|
||||
.fn_proto_param = .{
|
||||
.fn_proto_node_offset = src_node_offset,
|
||||
.param_index = @intCast(block.params.len), // va_arg must be the last parameter
|
||||
},
|
||||
});
|
||||
try sema.checkCallConvSupportsVarArgs(block, va_args_src, cc);
|
||||
}
|
||||
|
||||
const ret_poison = bare_return_type.isGenericPoison();
|
||||
|
||||
@ -11,7 +11,7 @@ comptime {
|
||||
// error
|
||||
// target=x86_64-linux
|
||||
//
|
||||
// :1:1: error: variadic function does not support 'auto' calling convention
|
||||
// :1:1: note: supported calling conventions: 'x86_64_sysv', 'x86_64_win'
|
||||
// :1:1: error: variadic function does not support 'inline' calling convention
|
||||
// :1:1: note: supported calling conventions: 'x86_64_sysv', 'x86_64_win'
|
||||
// :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'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user