|  | 
  | Posted by d-bugmail |  Permalink Reply |  
  | 
d-bugmail  
 
 
  | http://d.puremagic.com/issues/show_bug.cgi?id=1683
           Summary: Issue with variadic functions
           Product: DGCC aka GDC
           Version: 0.24
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: glue layer
        AssignedTo: dvdfrdmn@users.sf.net
        ReportedBy: mariusmuja@gmail.com
GDC fails to compile the following code:
--------------
import std.stdio;
void test(TypeInfo[] arguments, void* argptr)
{
    writefln("test(TypeInfo[] arguments, void* argptr)");
}
void test(...)
{
    writefln("test(..)");
}
void test2(...)
{
    test(_arguments, _argptr);
}
void main()
{
    test2(1,2,3);
}
--------------
with the error message:
--------------
test_args.d:15: function test_args.test called with argument types:
        (TypeInfo[],char*)
matches both:
        test_args.test(TypeInfo[],void*)
and:
        test_args.test(...)
----------------
With DMD the above code compiles and the test_args.test(TypeInfo[],void*)
function is called.
This issue prevents the usage under GDC of several functions from the tango
library, such as:
Layout(T).sprint (T[] result, T[] formatStr, ...) and
Layout(T).sprint (T[] result, T[] formatStr, TypeInfo[] arguments, ArgList
args)
-- 
 |