[Issue 12809] New: More strict nothrow check for try-finally statement
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon May 26 22:57:13 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12809
Issue ID: 12809
Summary: More strict nothrow check for try-finally statement
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: k.hara.pg at gmail.com
This is throwable function.
void test_finally1() nothrow
{
try
throw new Exception(""); // error
finally
{}
}
But if add assert(0); in finally block, the throwing exception should not cause
nothrow violation.
void test_finally2() nothrow
{
try
throw new Exception(""); // should not be error
finally
assert(0); // unconditional halt
}
I found the issue when I tested the following snippet.
void main() nothrow
{
scope(exit) assert(0);
throw new Exception("");
}
--
More information about the Digitalmars-d-bugs
mailing list