www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3269] New: pure functions silently become nothrow

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3269

           Summary: pure functions silently become nothrow
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrei metalanguage.com


class A
{
    pure static void raise(string s)
    {
        throw new Exception(s);
    }
}

void main()
{
    A.raise("a");
}

This code compiles and runs without an error!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 28 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3269


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch, wrong-code



// A pure function might have side effects, unless it is also nothrow.
// PATCH:     e2ir.c, line 288.

    e = el_una(op,tyret,ep);
    }
    else if (ep) {
-    e = el_bin(tf->ispure ? OPcallns : OPcall,tyret,ec,ep);
+    e = el_bin((tf->ispure && tf->isnothrow) ? OPcallns : OPcall,tyret,ec,ep);
    }
    else {
-    e = el_una(tf->ispure ? OPucallns : OPucall,tyret,ec);
+    e = el_una((tf->ispure && tf->isnothrow) ? OPucallns : OPucall,tyret,ec);
    }

    if (retmethod == RETstack)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 27 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3269


Leandro Lucarella <llucax gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |llucax gmail.com



PDT ---
Related SVN revision: http://www.dsource.org/projects/dmd/changeset/226

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 29 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3269


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



11:33:47 PST ---
Fixed dmd 2.036

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