[Bug 161] GDC prevents backend from removing dead functions

via D.gnu d.gnu at puremagic.com
Sun May 3 05:30:59 PDT 2015


http://bugzilla.gdcproject.org/show_bug.cgi?id=161

Iain Buclaw <ibuclaw at gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #2 from Iain Buclaw <ibuclaw at gdcproject.org> ---
This is the crux of the problem why we do what we do (snipped, shortened, and
with added clarity from std.exception).

----
private void bailOut() { assert(false); }

public T enforce(T value)
{
    if (!value)
        bailOut();
    return value;
}
----

When compiling the module, 'private bailOut' is would be seen as unused, and so
considered as a candidate for removal.  However, external modules that
instantiate 'public enforce' would indirectly need bailOut to exist.

I am aware that the spec says that 'private' in D is equivalent to 'static' in
C, but in practice, that it just doesn't work that way.

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20150503/738da19a/attachment.html>


More information about the D.gnu mailing list