--- Comment #2 from Marco Leise <> 2012-08-15 01:06:15 PDT ---
Since it all applies to FuncDeclaration::semantic3(...), I'll add this case:

  void b(Test t) nothrow {

  struct Test {
    ~this() {
      throw new Exception("i am throwing");

The compiler checks for thrown exceptions or - more generally - the block exit
state in two cases:



(2) handles the case of appending destructor calls for structs passed by value
to a function. Functions without return/throw/etc. just get the destructors
appended, while all others get them wrapped in a try-finally clause to ensure
they are called. Since destructors may throw and the function isn't checked
again after their addition, nothrow doesn't necessarily hold here. That's the
case in the above example.

(1) is the normal check if a function is nothrow, but throws. blockExit()
determines the way any code block exits. This may be through 'return', 'throw',
'goto', halt (assert(0)?), 'break', 'continue' or the execution may
unconditionally succeed or 'fall through'. That's my understanding anyways.

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

Reply via email to