Thread overview
[Issue 16972] Issue diagnostic for throwing from a scope(exit) block
Dec 14, 2016
Ali Cehreli
Jun 26, 2017
Vladimir Panteleev
Jun 26, 2017
Vladimir Panteleev
Jun 26, 2017
Ali Cehreli
Jun 26, 2017
Vladimir Panteleev
Dec 17, 2022
Iain Buclaw
December 14, 2016
https://issues.dlang.org/show_bug.cgi?id=16972

Ali Cehreli <acehreli@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
June 26, 2017
https://issues.dlang.org/show_bug.cgi?id=16972

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dlang-bugzilla@thecybershad
                   |                            |ow.net

--- Comment #1 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
Is it the compiler or the spec that's wrong? In a trivial test, throwing in a scope(exit) seems to work as expected, and if an exception is already in flight, the new one appears to be correctly chained.

--
June 26, 2017
https://issues.dlang.org/show_bug.cgi?id=16972

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
           Hardware|x86_64                      |All
                 OS|Linux                       |All

--
June 26, 2017
https://issues.dlang.org/show_bug.cgi?id=16972

--- Comment #2 from Ali Cehreli <acehreli@yahoo.com> ---
To complete, the spec says "A scope(exit) or scope(success) statement may not
exit with a throw, goto, break, continue, or return; nor may it be entered with
a goto."

And I found a very long forum thread:

  http://forum.dlang.org/post/m0l0p4$28la$1@digitalmars.com

--
June 26, 2017
https://issues.dlang.org/show_bug.cgi?id=16972

--- Comment #3 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
Good find. A pertinent post from that thread:

http://forum.dlang.org/post/1237688782434087169.692302SeeWebsiteForEmail-erdan.org@news.digitalmars.com

Indeed, it seems facetious to "forbid" throw but allow calling non-nothrow functions, and enforcing the latter is likely to break too much code now.

So, we need confirmation that the current compiler implementation is sane and deals with throws properly, after which the spec could be updated.

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=16972

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P4

--