title: Clang does not work properly with std::experimental::optional
body: <p>It seems that <em>clang</em> does not work properly with <code>std::experimental::optional</code>.<br/>
  Consider the following example:</p>
  
  <pre><code>#include &lt;experimental/optional&gt;
  #include &lt;iostream&gt;
  
  struct Foo { int bar; };
  
  int main() {
      Foo foo;
      std::experimental::optional&lt;Foo&gt; opt = foo;
      opt.value().bar = 42;
      std::cout &lt;&lt; opt.value().bar &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>It compiles fine with g++ version 5.3.1, but it doesn't neither with clang version 7.0.0 nor with clang version 7.0.2.<br/>
  The returned error is:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "std::experimental::bad_optional_access::~bad_optional_access()", referenced from:
      _main in main-11b2dd.o
  "typeinfo for std::experimental::bad_optional_access", referenced from:
      _main in main-11b2dd.o
  "vtable for std::experimental::bad_optional_access", referenced from:
      std::experimental::bad_optional_access::bad_optional_access() in main-11b2dd.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  ld: symbol(s) not found for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>I didn't manage to find any issue opened in the bug report for clang.<br/>
  Who is behaving properly? I guess g++ works fine, while clang seems to be bugged. Am I wrong?<br/></p>
  
  <p><strong>EDIT1</strong></p>
  
  <p>Actually, the bug seems to be due to the definition of <code>bad_optional_access</code>, even though the problem happens while using clang.</p>
  
  <p><strong>EDIT2</strong></p>
  
  <p>No command line parameters, but <code>-std=c++14</code>.<br/>
  Tests performed with clang on osx, it compiles fine (so <code>optional</code> is freely available) as far as you don't use the <code>value</code> member method.<br/>
  That means that it compiles and links using:</p>
  
  <pre><code>opt-&gt;bar
  </code></pre>
  
  <p>Instead of:</p>
  
  <pre><code>opt.value().bar
  </code></pre>