[cfe-dev] libc++ problem with clang trunk

Marshall Clow mclow.lists at gmail.com
Mon Nov 11 08:40:07 PST 2013


On Nov 11, 2013, at 6:16 AM, David Irvine <david.irvine at maidsafe.net> wrote:

> Hi Howard, thank for the super quick fix, it helped us, but I think we have further errors that may be related. (I know this does not fall on you by default and sorry for any presumption.)
> 
> In the code below, if the Do function is templated (no need to use the template parameter) then the following code will not since last Thursday. This is compiled with 
>  clang++ -std=c++11 -stdlib=libc++ -lc++abi -pthread test.cc 
> 
> Using TOT for libc++abi libc++ and clang (clang from llvm repository) on ubuntu 13.10
> 
> Commenting out the template line and swapover the code in main, then this works perfectly OK. Using libstdc++ is also OK.
> 
> I hope this helps.
> 
> #include <vector>
> #include <future>
> #include <memory>
> #include <thread>
> 
> 
> struct TestStruct {
>     int index;
> };
> 
> template<typename T>
> void Do() {
>   auto v = std::make_shared<std::vector<TestStruct>>(0, TestStruct());
>   auto fut(std::async(std::launch::async, [=] {
>                       v->size();
>   }));
> }
> 
> 
> int main() {
>   Do<TestStruct>();
>   // Do();
> }


When I build this with "last week's" clang, it compiles fine.
When I build it with "this mornings" clang, clang crashes.

Created  http://llvm.org/bugs/show_bug.cgi?id=17877


-- Marshall

Marshall Clow     Idio Software   <mailto:mclow.lists at gmail.com>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki





More information about the cfe-dev mailing list