Summary: scope x = new Foo; does not allocate on stack if Foo
                    has allocator
           Product: D
           Version: 1.044
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: patch, wrong-code
          Severity: normal
          Priority: P2
         Component: DMD

Created an attachment (id=379)
 --> (
Patch to fix bug

extern(C) int printf(char*, ...);

class Foo
        return null;

void main()
    scope x = new Foo;

Outputs "" 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.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to