title: std::async with gcc 7.2 need pthread link option
body: <p>The following code need pthread link option to compile, and i don't understand why. Do you have any idea?</p>
  
  <p>I'm using gcc 7.2.0</p>
  
  <pre><code>#include &lt;future&gt;
  
  int sum = 0;
  
  void func()
  {
     for(int i=0; i &lt; 10; ++i)
        sum +=i;
  }
  
  int main()
  {
      std::future&lt;void&gt; f =  std::async(std::launch::async, func);
      return 0;
  }
  </code></pre>
  
  <p>Compiling with </p>
  
  <pre><code>g++ -o test test.cpp
  </code></pre>
  
  <p>provides the following error</p>
  
  <pre><code>/tmp/ccoEkyeZ.o: dans la fonction « std::thread::thread&lt;std::__future_base::_Async_state_impl&lt;std::thread::_Invoker&lt;std::tuple&lt;void (*)()&gt; &gt;, void&gt;::_Async_state_impl(std::thread::_Invoker&lt;std::tuple&lt;void (*)()&gt; &gt;&amp;&amp;)::{lambda()#1}&gt;(std::__future_base::_Async_state_impl&lt;std::thread::_Invoker&lt;std::tuple&lt;void (*)()&gt; &gt;, void&gt;::_Async_state_impl(std::thread::_Invoker&lt;std::tuple&lt;void (*)()&gt; &gt;&amp;&amp;)::{lambda()#1}&amp;&amp;) »:
  test.cpp:(.text._ZNSt6threadC2IZNSt13__future_base17_Async_state_implINS_8_InvokerISt5tupleIJPFvvEEEEEvEC4EOS8_EUlvE_JEEEOT_DpOT0_[_ZNSt6threadC5IZNSt13__future_base17_Async_state_implINS_8_InvokerISt5tupleIJPFvvEEEEEvEC4EOS8_EUlvE_JEEEOT_DpOT0_]+0x30): référence indéfinie vers « pthread_create »
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>while using </p>
  
  <pre><code>g++ -o test test.cpp -lpthread
  </code></pre>
  
  <p>has no issue.</p>
  
  <p>is this normal? do i missing something? my code doesn't have pthread_create somewhere</p>