]>
Commit | Line | Data |
---|---|---|
b4c522fa IB |
1 | // https://issues.dlang.org/show_bug.cgi?id=17421 |
2 | ||
3 | import core.stdc.stdarg; | |
4 | ||
5 | void novar() {} | |
6 | extern(C) void cstyle(int, ...) {} | |
7 | extern(C++) void cppstyle(int, ...) {} | |
8 | void dstyle(...) {} | |
9 | void typesafe(int[]...) {} | |
10 | ||
11 | static assert(__traits(getFunctionVariadicStyle, novar) == "none"); | |
12 | static assert(__traits(getFunctionVariadicStyle, cstyle) == "stdarg"); | |
13 | static assert(__traits(getFunctionVariadicStyle, cppstyle) == "stdarg"); | |
14 | static assert(__traits(getFunctionVariadicStyle, dstyle) == "argptr"); | |
15 | static assert(__traits(getFunctionVariadicStyle, typesafe) == "typesafe"); | |
16 | ||
17 | static assert(__traits(getFunctionVariadicStyle, (int[] a...) {}) == "typesafe"); | |
18 | static assert(__traits(getFunctionVariadicStyle, typeof(cstyle)) == "stdarg"); | |
19 |