title: Program ends with "abort() has been called" error on VS2017
body: <p>Below code exits by giving error </p>
  
  <blockquote>
    <p>"abort() has been called".  </p>
  </blockquote>
  
  <p>Is it due to destructor throwing exception? I know throwing exception from destructor results in undefined behavior but there are counter arguments also. and moreover the same program works correct in VS 2012.</p>
  
  <pre><code>#include "stdafx.h"
  #include&lt;iostream&gt;
  using namespace std;
  class Txn
  {
   public:
       Txn()
       {
          cout&lt;&lt; "in Constructor" &lt;&lt; endl;
       };
  
      ~Txn()
      {
          try
          {
              cout &lt;&lt; "in destructor" &lt;&lt; endl;
              throw 10;
          }
          catch(int i)
          {
              cout &lt;&lt; "in destructor exception" &lt;&lt; endl;
              throw;
          }
      }
  };
  
  int main()
  {
      try
      {
          Txn t;
      }
      catch (int i)
      {
          cout &lt;&lt; "Exception" &lt;&lt; i &lt;&lt; endl;
      }
      return 0;
  }
  </code></pre>
  
  <p>VS2017 release notes does not mention anything around exception handling changes.  </p>
  
  <p>So i have below questions:</p>
  
  <ol>
  <li>Is it incorrect to throw exception in destructor from VS2017 onwards? will it always exit the program by calling abort()?</li>
  <li>Are there any flags with which we can make it work?</li>
  </ol>
  
  <p>Please suggest. </p>