[Issue 12809] More strict nothrow check for try-finally statement

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon May 26 23:00:14 PDT 2014


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

--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> ---
By fixing this issue, unreachable statement warning could be improved.

void test1()
{
    try
        assert(0);
    finally
    {
        int x = 1;  // should be reported as unreachable
    }
}

void test2()
{
    try
    {}
    finally
        assert(0);

    int x = 1;      // should be reported as unreachable
}

--


More information about the Digitalmars-d-bugs mailing list