Thread overview
[Issue 14981] [REG 2.068.0] Missing nothrow attribute in dbgVerifySorted()
[Issue 14981] Missing nothrow attribute in dbgVerifySorted()
Sep 30, 2015
Jack Stouffer
Oct 01, 2015
Kenji Hara
Nov 08, 2015
bb.temp@gmx.com
Nov 08, 2015
Tobias Pankrath
Nov 09, 2015
bb.temp@gmx.com
September 24, 2015
https://issues.dlang.org/show_bug.cgi?id=14981

jiki@red.email.ne.jp changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nicolas.jinchereau@gmail.co
                   |                            |m

--- Comment #1 from jiki@red.email.ne.jp ---
*** Issue 15091 has been marked as a duplicate of this issue. ***

--
September 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14981

Jack Stouffer <jack@jackstouffer.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jack@jackstouffer.com

--- Comment #2 from Jack Stouffer <jack@jackstouffer.com> ---
https://github.com/D-Programming-Language/phobos/pull/3678

--
September 30, 2015
https://issues.dlang.org/show_bug.cgi?id=14981

Steven Schveighoffer <schveiguy@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |schveiguy@yahoo.com
         Resolution|---                         |FIXED
            Summary|Missing nothrow attribute   |[REG 2.068.0] Missing
                   |in dbgVerifySorted()        |nothrow attribute in
                   |                            |dbgVerifySorted()
           Severity|normal                      |regression

--- Comment #3 from Steven Schveighoffer <schveiguy@yahoo.com> ---
Seems to be fixed in latest head. Not sure where it was fixed, possibly here:

https://github.com/D-Programming-Language/phobos/pull/3669

--
October 01, 2015
https://issues.dlang.org/show_bug.cgi?id=14981

--- Comment #4 from Kenji Hara <k.hara.pg@gmail.com> ---
(In reply to Steven Schveighoffer from comment #3)
> Seems to be fixed in latest head. Not sure where it was fixed, possibly here:
> 
> https://github.com/D-Programming-Language/phobos/pull/3669

Yes, it is. As far as I see, the `uniform` and `text` functions are not nothrow, then dbgVerifySorted was also inferred to throwable.

--
November 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14981

bb.temp@gmx.com changed:

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

--- Comment #5 from bb.temp@gmx.com ---
it looks like it was not fully fixed, still with -debug:

---
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;
}
---

see http://forum.dlang.org/post/mxmstidgckkacquiasix@forum.dlang.org

--
November 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14981

Tobias Pankrath <tobias@pankrath.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tobias@pankrath.net

--- Comment #6 from Tobias Pankrath <tobias@pankrath.net> ---
Making dbgVerifySorted a template function fixes this instance. Probably because the compiler will infer it is nothrow.

--
November 08, 2015
https://issues.dlang.org/show_bug.cgi?id=14981

Steven Schveighoffer <schveiguy@yahoo.com> changed:

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

--- Comment #7 from Steven Schveighoffer <schveiguy@yahoo.com> ---
dbgVerifySorted is part of a SortedRange, which is a template. member functions of templates are also allowed to be inferred using the compiler.

This is why dbgVerifySorted was fixed in PR by the removal of the RNG (and not adding nothrow specifically).

Either this is a compiler bug or somehow the comparison function isn't implied to be nothrow.

Note that there's no 'nothrow' in your code, which makes me feel like the compiler is outsmarting itself.

I think this is a new bug. Please open a new one, as the original regression was fixed.

--
November 09, 2015
https://issues.dlang.org/show_bug.cgi?id=14981

--- Comment #8 from bb.temp@gmx.com ---
(In reply to Steven Schveighoffer from comment #7)
> dbgVerifySorted is part of a SortedRange, which is a template. member functions of templates are also allowed to be inferred using the compiler.
> 
> This is why dbgVerifySorted was fixed in PR by the removal of the RNG (and not adding nothrow specifically).
> 
> Either this is a compiler bug or somehow the comparison function isn't implied to be nothrow.
> 
> Note that there's no 'nothrow' in your code, which makes me feel like the compiler is outsmarting itself.
> 
> I think this is a new bug. Please open a new one, as the original regression was fixed.

https://issues.dlang.org/show_bug.cgi?id=15304

--