Rollup merge of #42249 - Mark-Simulacrum:issue-40244, r=eddyb
Allow variadic functions with cdecl calling convention. Fixes #40244.
This commit is contained in:
commit
4e5812cee4
5 changed files with 13 additions and 10 deletions
|
|
@ -9,7 +9,7 @@
|
|||
// except according to those terms.
|
||||
|
||||
extern "Rust" { fn foo(x: u8, ...); } //~ ERROR E0045
|
||||
//~| NOTE variadics require C calling conventions
|
||||
//~| NOTE variadics require C or cdecl calling convention
|
||||
|
||||
fn main() {
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
fn baz(f: extern "cdecl" fn(usize, ...)) {
|
||||
//~^ ERROR: variadic function must have C calling convention
|
||||
// ignore-arm stdcall isn't suppported
|
||||
|
||||
fn baz(f: extern "stdcall" fn(usize, ...)) {
|
||||
//~^ ERROR: variadic function must have C or cdecl calling convention
|
||||
f(22, 44);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,10 @@
|
|||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
extern "cdecl" {
|
||||
fn printf(_: *const u8, ...); //~ ERROR: variadic function must have C calling convention
|
||||
// ignore-arm stdcall isn't suppported
|
||||
|
||||
extern "stdcall" {
|
||||
fn printf(_: *const u8, ...); //~ ERROR: variadic function must have C or cdecl calling
|
||||
}
|
||||
|
||||
extern {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue