title: An exception gets thrown twice from a constructor with a function-try-block
body: <p>Why does the following exception thrown from the constructor of class A get caught twice, first by the catch within the constructor itself and second time by the catch in the main function?</p>
  
  <p>Why doesn't it get caught just once by the catch within the constructor?</p>
  
  <pre><code> #include &lt;iostream&gt;
      using namespace std;
  
      class E {
         public:
            const char* error;
            E(const char* arg) : error(arg) { }
      };
  
      class A {
         public:
            int i;
  
            A() try : i(0) {
               throw E("Exception thrown in A()");
            }
            catch (E&amp; e) {
               cout &lt;&lt; e.error &lt;&lt; endl;
            }
      };
  
      int main() {
  
         try {
            A x;
         }
         catch(...) 
         {
          cout &lt;&lt; "Exception caught" &lt;&lt; endl; 
         }
      }
  </code></pre>
  
  <p>If I remove the try-catch block in the main function, the program will crash. 
  Here is the output:</p>
  
  <pre><code>Exception thrown in A()
  terminate called after throwing an instance of 'E'
  zsh: abort (core dumped)  ./main
  </code></pre>
  
  <p>Why does it crash without the try-catch block in the main function?</p>