title: Why std::atom::is_lock_free doesn't compile?
body: <p>Just a bit code of C++11:</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;atomic&gt;
  
  struct A { int a[4]; };
  struct B { int x, y; };
  int main()
  {
      std::cout &lt;&lt; std::boolalpha
              &lt;&lt; "std::atomic&lt;A&gt; is lock free? "
              &lt;&lt; std::atomic&lt;A&gt;{}.is_lock_free() &lt;&lt; '\n'
              &lt;&lt; "std::atomic&lt;B&gt; is lock free? "
              &lt;&lt; std::atomic&lt;B&gt;{}.is_lock_free() &lt;&lt; '\n';
  }
  </code></pre>
  
  <p>Compile with mac+clang, it gives error:</p>
  
  <pre><code>Undefined symbols for architecture x86_64:
  "___atomic_is_lock_free", referenced from:
      _main in atomics.o
  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>clang + ubuntu docker gives:</p>
  
  <pre><code>root@b01946bedcf2:/# clang++ --version
  clang version 4.0.0-1ubuntu1 (tags/RELEASE_400/rc1)
  Target: x86_64-pc-linux-gnu
  Thread model: posix
  InstalledDir: /usr/bin
  root@b01946bedcf2:/# clang++ 1.cpp -std=c++11 -lpthread
  /tmp/1-7cc6e9.o: In function `std::atomic&lt;A&gt;::is_lock_free() const':
  1.cpp:(.text._ZNKSt6atomicI1AE12is_lock_freeEv[_ZNKSt6atomicI1AE12is_lock_freeEv]+0x1b): undefined reference to `__atomic_is_lock_free'
  /tmp/1-7cc6e9.o: In function `std::atomic&lt;B&gt;::is_lock_free() const':
  1.cpp:(.text._ZNKSt6atomicI1BE12is_lock_freeEv[_ZNKSt6atomicI1BE12is_lock_freeEv]+0x1b): undefined reference to `__atomic_is_lock_free'
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  </code></pre>
  
  <p>And on RHEL7+gcc4.8.5, it gives:</p>
  
  <pre><code>$g++ 1.cpp -std=c++11 -lpthread &amp;&amp; ./a.out
  /tmp/ccW9pNc2.o: In function `std::atomic&lt;A&gt;::is_lock_free() const':
  1.cpp:(.text._ZNKSt6atomicI1AE12is_lock_freeEv[_ZNKSt6atomicI1AE12is_lock_freeEv]+0x17): undefined reference to `__atomic_is_lock_free'
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>This is really odd. What's wrong with the code, or does it require a super-high version of compiler?</p>