Walter Bright <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #5 from Walter Bright <> 2010-10-29 
03:21:11 PDT ---
Out of memory errors should be allowed inside nothrow.

Also, I suspect it would be good to disallow:

catch (Exception e)
   /* nothing here */

where all exceptions are swallowed and ignored. This kind of thing happens in
Java to work around exception specifications, but I don't see a need for it
here. Of course, there would still be ways to swallow & ignore (just put in a
call to a do-nothing function), but such shouldn't be easy.

What do you think?

--- Comment #6 from Jonathan M Davis <> 2010-10-29 03:37:35 
PDT ---
There are plenty of cases where you know that a function will never throw but
it's not nothrow (perhaps because it can throw in other circumstances), and
you're forced to catch the Exception anyway (probably because you're in a
nothrow function). Personally, I use assert(0) for such cases.

As long as disallowing empty catch blocks is really for _empty_ catch blocks
(or catch blocks with only a comment), I don't mind. But there are definitely
cases where you want to eat an exception or where there should never be one but
you have to have a try-catch anyway.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to