[Issue 20167] Issue warning when result discarded from strong pure function?

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 21 13:31:39 UTC 2021


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

Nicholas Wilson <iamthewilsonator at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iamthewilsonator at hotmail.co
                   |                            |m

--- Comment #3 from Nicholas Wilson <iamthewilsonator at hotmail.com> ---
> Why wasn't `nothrow` inferred for this trivial function where the source is as plain as day to the compiler?

FWIW the compiler does inference if the function is a template or the return
type is auto: that is 

auto f() {
    return 1;
}

and 

int f()() {
    return 1;
}

will trigger a warning when compiled with -w

--


More information about the Digitalmars-d-bugs mailing list