<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 --- - Wrong make_shared picked when boost::make_shared is imported"
   href="http://llvm.org/bugs/show_bug.cgi?id=18969">18969</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Wrong make_shared picked when boost::make_shared is imported
          </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>MacOS X
          </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++
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>sunnylandh@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=12149" name="attach_12149" title="code to reproduce issue">attachment 12149</a> <a href="attachment.cgi?id=12149&action=edit" title="code to reproduce issue">[details]</a></span>
code to reproduce issue

Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix


// clang++ -I/opt/local/include/ make-shared.cc

#include <string>
#include <list>
#include <boost/make_shared.hpp>

class Z
{
public:
  explicit
  Z(std::string a)
  {
  }
};

using boost::shared_ptr;
using boost::make_shared;

int main() {
  std::string a;

  shared_ptr<Z> z = make_shared<Z>(a);
}


This code does not compile with clang++. Compiler complains:

make-shared.cc:22:17: error: no viable conversion from 'shared_ptr<Z>' (aka
      'std::__1::shared_ptr<Z>') to 'shared_ptr<Z>' (aka
'boost::shared_ptr<Z>')


libboost is version 1.55 installed from Macports.

It seems that std::__1::make_shared is picked, even if boost::make_shared is
imported to current namespace. This happens only if the Z constructor takes a
STL type such as std::string or std::list<int>. It does not happen if Z
constructor takes an int.</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>