title: Templated function with defaulted std::function parameter causes symbol [...] already defined
body: <p>I just ran into something somewhat odd.
  I wonder if it's a bug, and if not I hope someone can explain the issue.</p>
  
  <p>My issue is that when I create a templated function which takes an <code>std::function</code> as a defaulted parameter, I can only create one template instantiation of this function, otherwise I get an error.</p>
  
  <p>Consider the following code:</p>
  
  <pre><code>#include &lt;functional&gt;
  
  template&lt;bool B&gt;
  void wut(std::function&lt;void()&gt; f = []() {})
  {
      f();
  }
  
  int main() {
      wut&lt;false&gt;(); // works
      wut&lt;false&gt;(); // still works
      wut&lt;true&gt;();  // error
      return 0;
  }
  </code></pre>
  
  <p><a href="https://ideone.com/VlVcUv" rel="nofollow noreferrer">https://ideone.com/VlVcUv</a></p>
  
  <p>When compiling this code I get the following error:</p>
  
  <pre><code>{standard input}: Assembler messages:
  {standard input}:28: Error: symbol `_ZNSt14_Function_base13_Base_managerIUlvE_E10_M_managerERSt9_Any_dataRKS3_St18_Manager_operation' is already defined
  {standard input}:127: Error: symbol `_ZNSt17_Function_handlerIFbvEUlvE_E9_M_invokeERKSt9_Any_data' is already defined
  </code></pre>