id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 7201,boost::make_shared clobbers libstdc++ std::thread,t551@…,Peter Dimov,"This program fails to compile using g++ version 4.7.1. {{{ #!cpp #include #include #include void demo_entry( boost::shared_ptr &demo_ptr ) { } int main(int argc, char **argv) { auto demo_ptr = boost::make_shared(5); std::thread demo_thread( demo_entry, std::ref(demo_ptr) ); demo_thread.join(); return 0; } }}} I get the following error output: {{{ #!sh [100%] Building CXX object CMakeFiles/make_shared_repro.dir/make_shared_repro.cpp.o In file included from /home/ahmedtd/project/make-shared-repro/make_shared_repro.cpp:3:0: /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/include/g++-v4/thread: In instantiation of 'std::shared_ptr > std::thread::_M_make_routine(_Callable&&) [with _Callable = std::_Bind_simple >))(boost::shared_ptr&)>]': /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/include/g++-v4/thread:133:9: required from 'std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (&)(boost::shared_ptr&); _Args = {std::reference_wrapper >}]' /home/ahmedtd/project/make-shared-repro/make_shared_repro.cpp:20:5: required from here /usr/lib/gcc/x86_64-pc-linux-gnu/4.7.1/include/g++-v4/thread:191:67: error: could not convert 'boost::make_shared(Arg1&&, Args&& ...) [with T = std::thread::_Impl >))(boost::shared_ptr&)> >; Arg1 = std::_Bind_simple >))(boost::shared_ptr&)>; Args = {}]()' from 'boost::shared_ptr >))(boost::shared_ptr&)> > >' to 'std::shared_ptr >))(boost::shared_ptr&)> > >' make[2]: *** [CMakeFiles/make_shared_repro.dir/make_shared_repro.cpp.o] Error 1 make[1]: *** [CMakeFiles/make_shared_repro.dir/all] Error 2 make: *** [all] Error 2 }}} After deciphering the template error, it appears the problem stems from line 194 in the libstdc++ header, which has a non-namespace-qualified call to make_shared. For some reason, even though this code is declared in the `std` namespace, it is deciding to use boost::make_shared. This is particularly strange because at the point `` is processed by the compiler, no boost code has yet been included. I have no idea whether this is bug in boost::smart_ptr, libstdc++, or the compiler itself.",Bugs,closed,To Be Determined,smart_ptr,Boost 1.49.0,Problem,fixed,make_shared thread,flast@…