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.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
fn foo(...) void {}
|
||||
fn bar(a: anytype, ...) callconv(a) void {}
|
||||
inline fn foo2(...) void {}
|
||||
|
||||
comptime {
|
||||
_ = foo;
|
||||
@@ -7,10 +8,16 @@ comptime {
|
||||
comptime {
|
||||
_ = bar;
|
||||
}
|
||||
comptime {
|
||||
_ = foo2;
|
||||
}
|
||||
|
||||
// error
|
||||
// backend=stage2
|
||||
// target=native
|
||||
//
|
||||
// :1:1: error: variadic function must have 'C' calling convention
|
||||
// :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'
|
||||
|
||||
Reference in New Issue
Block a user