| 1 |
// { dg-do compile } |
| 2 |
// { dg-options "-Wbuiltin-declaration-mismatch" } |
| 3 |
|
| 4 |
extern(C): |
| 5 |
|
| 6 |
// Mismatched parameter lengths |
| 7 |
double tan(); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" } |
| 8 |
|
| 9 |
// Mismatched variadic arguments |
| 10 |
int printf(const(char)*); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" } |
| 11 |
|
| 12 |
// Mismatched return type |
| 13 |
void puts(char*); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" } |
| 14 |
|
| 15 |
// Mismatched return storage class |
| 16 |
ref int isalnum(int); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" } |
| 17 |
|
| 18 |
// Mismatched parameter type |
| 19 |
double sin(long); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" } |
| 20 |
|
| 21 |
// Mismatched parameter storage class |
| 22 |
double frexp(double, lazy int*); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" } |
| 23 |
double log(ref double); // { dg-warning "\\\[-Wbuiltin-declaration-mismatch]" } |
| 24 |
|
| 25 |
// Verify that storage classes don't affect covariance matching |
| 26 |
@trusted nothrow @nogc pure double fabs(double); |
| 27 |
|
| 28 |
// Verify inout is allowed instead of const |
| 29 |
inout(char)* strstr(return scope inout(char)*, scope const char*) pure; |
| 30 |
|
| 31 |
// Verify that FILE* is allowed as it is implicitly convertable to void* |
| 32 |
struct _IO_FILE{} |
| 33 |
alias FILE = shared(_IO_FILE); |
| 34 |
int fprintf(FILE*, scope const char*, scope const ...); |
| 35 |
|
| 36 |
// Verify integral types with same size are treated as if equivalent |
| 37 |
int putchar(dchar); |