Created attachment 379
Patch to fix bug
extern(C) int printf(char*, ...);
class Foo
{
new(size_t)
{
printf("Foo.new\n");
return null;
}
}
void main()
{
scope x = new Foo;
}
Outputs "Foo.new" at runtime, even though the spec says that objects having custom allocators will be allocated on the stack if they are called without arguments to new.
This seems to be caused by dmd automatically prepending the class size to new's arguments list, so it always has at least one argument.
Attached is a patch to fix this.