www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2793] New: Unreachable code in Phobos std.algorithm sort

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

           Summary: Unreachable code in Phobos std.algorithm sort
           Product: D
           Version: 2.026
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: Phobos
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: gide nwawudu.com


The following code does not compile with warnings enabled (-w). Commenting out
src\phobos\std\algorithm.d lines 2119 and 2121 fixes the issue.

import std.algorithm;

void main() {
        int[] a = [1, 2, 3];
        sort(a);
}

C:> dmd -w test.d
warning - C:\D\dmd\windows\bin\..\..\src\phobos\std\algorithm.d(2119): Error:
statement is not reachable
C:\D\dmd\windows\bin\..\..\src\phobos\std\algorithm.d(2504): template instance
std.algorithm.sortImpl!(binaryFun,ss,iterSwap,int[]).sortImpl.partition!(pred,ss,iterSwap,int[])
error instantiating


-- 
Apr 03 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2793


gide nwawudu.com changed:

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




------- Comment #1 from gide nwawudu.com  2009-05-02 08:53 -------
Fixed in DMD 2.029.


-- 
May 02 2009