<html>
    <head>
      <base href="https://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 --- - Generic lambda causes linker error when capturing non-POD object with implicit copy ctor" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23855&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=j1J-NMgmNxFlobGJDlZWV8JPp3CZy_POCwrRRlCZh-w&s=3vhp6dfUUrL_LcZ78TvT8TyElhIoQNWUYHVlk0Avt7g&e=">23855</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Generic lambda causes linker error when capturing non-POD object with implicit copy ctor
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>3.6
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>C++14
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>jvp4846@g.rit.edu
          </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=14475" name="attach_14475" title="Test case">attachment 14475</a> <a href="attachment.cgi?id=14475&action=edit" title="Test case">[details]</a></span>
Test case

Note: This sounds really similar to <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed" title="RESOLVED FIXED - generic lambda capture fails with undefined reference to custom copy ctor" href="show_bug.cgi?id=22354">bug 22354</a>, but it's still present in 3.6.

Compiling the attached test case under clang 3.6 succeeds, but *fails* during
linking:

  $ clang++-3.6 -std=c++1y test.cpp
  /tmp/test-1c245e.o: In function `see_the_animals()':
  test.cpp:(.text+0x1a): undefined reference to `zoo::zoo(zoo const&)'
  clang: error: linker command failed with exit code 1 (use -v to see
invocation)

Here's my clang version (it should be from the LLVM apt repo):

  Ubuntu clang version 3.6.0-2ubuntu1~trusty1 (tags/RELEASE_360/final) (based
on LLVM 3.6.0)
  Target: x86_64-pc-linux-gnu
  Thread model: posix</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>