Thread overview
[Issue 9913] New: static if (__traits(compiles)...) causes program to hang
Oct 07, 2013
Walter Bright
April 09, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9913

           Summary: static if (__traits(compiles)...) causes program to
                    hang
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: callumenator@gmail.com


--- Comment #0 from callumenator@gmail.com 2013-04-09 13:37:49 PDT ---
DMD 2.062 Win32

import std.stdio, std.typecons;

void main()
{
    int ee = 0;
    static if (__traits(compiles, { Unique!int(&ee);}))
       auto e = Unique!int(&ee);
    writeln(e); // required to trigger
}

With the static if conditional (which passes) the writeln line causes the program to hang indefinitely after printing the expected result. Remove the static if conditional, and the program does not hang, behaves correctly.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 11, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9913



--- Comment #1 from callumenator@gmail.com 2013-06-10 17:03:04 PDT ---
(In reply to comment #0)

Still present in 2.063 (Win32).

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 07, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9913


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice                         |
                 CC|                            |bugzilla@digitalmars.com


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2013-10-07 00:08:19 PDT ---
Not an ice, as dmd itself does not hang. The compiled program does. Removed ice keyword.

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