Bug 15304 – [REG 2.068.0] Error about SortedRange not being nothrow in debug mode
Status
RESOLVED
Resolution
WORKSFORME
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-11-09T00:29:00Z
Last change time
2017-07-07T12:42:58Z
Keywords
rejects-valid
Assigned to
nobody
Creator
b2.temp
Comments
Comment #0 by b2.temp — 2015-11-09T00:29:07Z
Compile the following program with dmd '-debug' switch:
---
import std.algorithm, std.container;
void main()
{
static bool compare(P a, P b)
{
return a.curColumn < b.curColumn;
}
Array!P a = make!(Array!P);
sort!compare(a[]);
}
struct P
{
int curColumn = 0;
}
---
To get:
---
/usr/include/dmd/phobos/std/range/package.d(7245,24): Error: 'std.range.SortedRange!(RangeT!(Array!(P)), compare).SortedRange.dbgVerifySorted' is not nothrow
/usr/include/dmd/phobos/std/algorithm/sorting.d(1027,29): Error: template instance std.range.assumeSorted!(compare, RangeT!(Array!(P))) error instantiating
/tmp/temp_7F0849317830.d(10,17): instantiated from here: sort!(compare, cast(SwapStrategy)0, RangeT!(Array!(P)))
---
while without '-debug' the program can be compiled
I don't quite see how this is related to the #4845 PR.
Didn't we enable attribute inference for nested functions at some point?
Why would assumeSorted even insist on the predicate to be nothrow?
Seems like sth. with attribute inference is wrong here, we already hit plenty of issues with dbgVerifySorted.
Comment #5 by greensunny12 — 2017-07-05T18:17:05Z
I can't reproduce this, so I am assuming it has been fixed on the road. Please reopen, if this is still an issue for you.
Comment #6 by dlang-bugzilla — 2017-07-07T05:54:04Z
Just curious, how does such a fix get put into the changelog? Or does it not make it in?
Comment #8 by greensunny12 — 2017-07-07T12:19:26Z
> ust curious, how does such a fix get put into the changelog? Or does it not make it in?
https://github.com/dlang-bots/dlang-bot#automated-references
For every release the changed.d script aggregates all commits of all six dlang repos (dmd,druntime,phobos,tools,dlang.org,installer) and searches for the Bugzilla Issue regex.
Hence, it's important to link issues with the Dlang-Bot.
Moreover, since 2.073 the changed.d also aggregates all *.dd files in the /changelog folders of the dlang repos.
Btw since 2.074.0 we automatically generate the pending changelog, e.g. https://dlang.org/changelog/2.075.0_pre.html
[1] https://github.com/dlang/tools/blob/master/changed.d
Comment #9 by schveiguy — 2017-07-07T12:36:49Z
So I'm inferring from your answer, this won't get in the changelog.
Because technically, this should be in the changelog on an older release of D. It was fixed at some point, inadvertently, but the bug was not closed at that time. Is there any recourse for updating an old changelog? We can just add it manually to an older version right?
Comment #10 by greensunny12 — 2017-07-07T12:42:58Z