implicit instantiation of undefined template: Boost Bug or Clang Bug?

后端 未结 1 945
栀梦
栀梦 2021-01-23 00:27

I was trying to compile some code that uses Boost (1.49), with Clang(& libc++) from trunk. The problematic code boils down to the following:

#include 

        
1条回答
  •  一整个雨季
    2021-01-23 00:44

    The code in foreign_ptr.hpp is a redeclaration (if shared_ptr has already been defined), and as such not likely to cause problems (adding declarations to std is technically undefined behavior, but most compilers don't care since they don't really distinguish between standard library headers and other files). So the error can only be caused by shared_ptr being actually undefined.

    Now libc++ obviously has a definition shared_ptr, so I can only suspect some C++03 library made it to the include path somehow and got preferred over libc++.

    0 讨论(0)
提交回复
热议问题