It seems that *clang* does not work properly with `std::experimental::optional`.  

Consider the following example:

```
#include <experimental/optional>
#include <iostream>

struct Foo { int bar; };

int main() {
    Foo foo;
    std::experimental::optional<Foo> opt = foo;
    opt.value().bar = 42;
    std::cout << opt.value().bar << std::endl;
}

```

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.  

The returned error is:

```
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)

```

I didn't manage to find any issue opened in the bug report for clang.  

Who is behaving properly? I guess g++ works fine, while clang seems to be bugged. Am I wrong?  

**EDIT1**

Actually, the bug seems to be due to the definition of `bad_optional_access`, even though the problem happens while using clang.

**EDIT2**

No command line parameters, but `-std=c++14`.  

Tests performed with clang on osx, it compiles fine (so `optional` is freely available) as far as you don't use the `value` member method.  

That means that it compiles and links using:

```
opt->bar

```

Instead of:

```
opt.value().bar

```