[Issue 2793] New: Unreachable code in Phobos std.algorithm sort
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Apr 3 12:07:13 PDT 2009
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 at digitalmars.com
ReportedBy: gide at 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
--
More information about the Digitalmars-d-bugs
mailing list