]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/compilable/test17421.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / test17421.d
CommitLineData
b4c522fa
IB
1// https://issues.dlang.org/show_bug.cgi?id=17421
2
3import core.stdc.stdarg;
4
5void novar() {}
6extern(C) void cstyle(int, ...) {}
7extern(C++) void cppstyle(int, ...) {}
8void dstyle(...) {}
9void typesafe(int[]...) {}
10
11static assert(__traits(getFunctionVariadicStyle, novar) == "none");
12static assert(__traits(getFunctionVariadicStyle, cstyle) == "stdarg");
13static assert(__traits(getFunctionVariadicStyle, cppstyle) == "stdarg");
14static assert(__traits(getFunctionVariadicStyle, dstyle) == "argptr");
15static assert(__traits(getFunctionVariadicStyle, typesafe) == "typesafe");
16
17static assert(__traits(getFunctionVariadicStyle, (int[] a...) {}) == "typesafe");
18static assert(__traits(getFunctionVariadicStyle, typeof(cstyle)) == "stdarg");
19