title: Why does clang++ destroy only one foo object?
body: <p>I have the following example code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  struct foo {
      foo()  { cout &lt;&lt; "foo constructed.\n"; }
      ~foo() { cout &lt;&lt; "foo destroyed.\n"; }
  };
  
  struct bar {
      bar(foo t=foo{}) { }
  };
  
  int main(int argc, char **argv) {
      bar X[2]{};
      return 0;
  }
  </code></pre>
  
  <p>When I compile it with clang++ -std=c++11 test.cc, the program produces the following output:</p>
  
  <pre><code>foo constructed.
  foo constructed.
  foo destroyed.
  </code></pre>
  
  <p>but I expected an additional "foo destroyed." between the two "foo constructed." lines. Why is only one foo destroyed? This happens with clang 3.5.1 as well as 3.6.0.</p>