title: What's the use of a finally block preceded by a catch-all catch block, in C#?
body: <p>Consider the following C# code structure (S0-S3 are placeholders for arbitrary code blocks):</p>
  
  <pre><code>try
  {
      S0;
  }
  catch (Exception ex)
  {
      S1;
  }
  finally
  {
      S2;
  }
  
  S3;
  </code></pre>
  
  <p>In the case that S1 throws an exception inside the <code>catch</code> handler, S2 inside the <code>finally</code> will still execute (but S3 will not).</p>
  
  <h2>Question</h2>
  
  <p><em>Assuming that S1 cannot throw</em>, is there any point in having S2 inside a <code>finally</code> block, rather than having it outside the try/catch/finally, just before S3?</p>
  
  <h2>Example</h2>
  
  <pre><code>try
  {
      // Do something that might throw
  }
  catch (Exception ex)
  {
      // Save the exception to re-throw later
      // NB: This statement cannot throw an exception!
      this.cachedException = ex;
  }
  finally
  {
      S2;
  }
  
  S3;
  </code></pre>
  
  <p>Is there any point in having the <code>finally</code> block? Would the following code not be equivalent (under the strict assumption that what's inside the <code>catch</code> block cannot throw):</p>
  
  <pre><code>try
  {
      // Do something that might throw
  }
  catch (Exception ex)
  {
      // Save the exception to re-throw later
      // NB: This statement cannot throw an exception!
      this.cachedException = ex;
  }
  
  // No finally block needed (?)
  S2;
  S3;
  </code></pre>
  
  <h2>Secondary Question</h2>
  
  <p><strong>Update:</strong> If it is accepted that the two code blocks above are equivalent (under the assumptions stated) then, taking into account the feedback on code clarity in the answers, would it be preferrable (and equivalent) to combine S2 and S3 inside the <code>finally</code> block?</p>
  
  <pre><code>try
  {
      // Do something that might throw
  }
  catch (Exception ex)
  {
      // Save the exception to re-throw later
      // NB: This statement cannot throw an exception!
      this.cachedException = ex;
  }
  finally
  {
      S2; // Put S2 and S3 together inside the `finally` block to guard against
      S3; // future changes in the `catch` filter, or handling code.
  }
  </code></pre>