<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 --- - Linker error complaining about undefined reference to std::__enabled_shared_from_this_helper"
   href="http://llvm.org/bugs/show_bug.cgi?id=18386">18386</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Linker error complaining about undefined reference to std::__enabled_shared_from_this_helper
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.3
          </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>normal
          </td>
        </tr>

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

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

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

        <tr>
          <th>Reporter</th>
          <td>extproxy@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, 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=11822" name="attach_11822" title="Code file that clang has trouble compiling">attachment 11822</a> <a href="attachment.cgi?id=11822&action=edit" title="Code file that clang has trouble compiling">[details]</a></span>
Code file that clang has trouble compiling

Please see attached file clang_bug.cc. When I compile it with clang, I get a
linker error as given below. The file compiles fine with g++ 4.8.1.


clang++ -std=c++0x -g clang_bug.cc 
/tmp/clang_bug-aZhS4N.o: In function
`__shared_ptr<std::allocator<SubClass::AnotherClass>, >':
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/shared_ptr_base.h:992:
undefined reference to `void std::__enable_shared_from_this_helper<Base,
SubClass::AnotherClass>(std::__shared_count<(__gnu_cxx::_Lock_policy)2> const&,
std::enable_shared_from_this<Base> const*, SubClass::AnotherClass const*)'
clang: error: linker command failed with exit code 1 (use -v to see invocation)</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>