<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Using std::bind with std::function leads to stack overflow"
   href="http://llvm.org/bugs/show_bug.cgi?id=16385">16385</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Using std::bind with std::function leads to stack overflow
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.2
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>release blocker
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>hhinnant@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>spam@madsitenet.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=10709" name="attach_10709" title="a.cpp">attachment 10709</a> <a href="attachment.cgi?id=10709&action=edit" title="a.cpp">[details]</a></span>
a.cpp

I'm using the 3.3 sources from the following page:
<a href="http://llvm.org/releases/download.html#3.3">http://llvm.org/releases/download.html#3.3</a>

If the first parameter to a std::bind is a std::function, the code does not
work. The stack shows up to 63k recursive calls to:
std::__1__function<float (float,
float)>::function<std::__1::__bind<std::__1::function<float (float, float)>&,
float, float > > ()

How to compile:
clang++ -std=c++11 -stdlib=libc++ -lcxxrt -ldl a.cpp</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>