[Issue 12310] New: [CTFE] Support heap allocation for built-in scalar types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Mar 7 01:01:56 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12310

           Summary: [CTFE] Support heap allocation for built-in scalar
                    types
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: CTFE, rejects-valid
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2014-03-07 01:01:50 PST ---
Test case:

bool test()
{
    auto p = new int;
    assert(*p == 0);
    *p = 10;
    assert(*p == 10);

    auto q = new int(3);   // newly supported syntax by the issue 9112
    assert(*q == 3);
    *p = 20;
    assert(*p == 20);

    return true;
}
static assert(test());

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list