[Issue 6919] New: [CTFE] Cannot get effect to local variable through its pointer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 9 03:28:33 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6919

           Summary: [CTFE] Cannot get effect to local variable through its
                    pointer
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          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> 2011-11-09 03:27:55 PST ---
void formattedRead(int* val)
{
    *val = 1;
}
void test()
{
    int n;
    formattedRead(&n);
    assert(n == 1);  // fails!
}
static assert({ test(); return true; }());

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


More information about the Digitalmars-d-bugs mailing list