title: why does it cause termination if I try to throw something inside a catch block in C++
body: <p>I have the following C++ code and it gives me a surprise.
  The problem is that if I throw something except re-throw inside the catch block,
  the program will be terminated by calling abort and give the error message in GCC4,
  "terminate called after throwing an instance of 'int'".
  If I just use "throw;" to re-throw inside the catch block, everything will be fine.</p>
  
  <pre><code>#include &lt;iostream&gt; 
  #include &lt;exception&gt;
  #include &lt;stdexcept&gt;
  
  using namespace std;
  
  int main()
  {
      try{
          throw std::string("first throw");
      }
      catch(std::string &amp;x){
          try{
              std::cout &lt;&lt; x &lt;&lt; std::endl;
  //          throw;  // if I use this line, all is fine.
              throw int(2); // but if I use this line, it causes Abort() to be called
          }
          catch (int &amp;k){
              throw;
          }
          catch(...)
          {
              cout &lt;&lt; "all handled here!"&lt;&lt; endl;
          }
      }
      catch(...){
          std::cout&lt;&lt; "never printed" &lt;&lt; endl;
      }
  }
  </code></pre>