[libc++] iostream problem on Linux?

Hi,

Using:

clang r190394
libc++ r190513
libc++abi r190513
Linux x86-64

The following program:

#include
using namespace std;

int main()
{
cout << “foo” << endl;
return 0;
}

crashes with:

terminating with uncaught exception of type std::bad_cast: std::bad_cast
[1] 24931 abort ./a.out

gdb trace shows:

(gdb) bt
#0 0x00007ffff6fad849 in raise () from /lib64/libc.so.6
#1 0x00007ffff6faecd8 in abort () from /lib64/libc.so.6
#2 0x00007ffff7b9ebc7 in abort_message (format=) at …/src/abort_message.cpp:47
#3 0x00007ffff7b9ed2d in default_terminate_handler () at …/src/cxa_default_handlers.cpp:62
#4 0x00007ffff7bd4003 in std::__terminate (func=0x6168) at …/src/cxa_handlers.cpp:67
#5 0x00007ffff7bd37d2 in failed_throw (exception_header=) at …/src/cxa_exception.cpp:147
#6 __cxa_throw (thrown_object=0x605090, tinfo=, dest=) at …/src/cxa_exception.cpp:242
#7 0x00007ffff788e718 in std::__1::locale::__imp::use_facet(long) const () from /usr/lib64/libc++.so.1
#8 0x00007ffff788f081 in std::__1::locale::use_facet(std::__1::locale::id&) const () from /usr/lib64/libc++.so.1
#9 0x00000000004018e3 in std::__1::basic_ostream<char, std::__1::char_traits >& std::__1::endl<char, std::__1::char_traits >(std::__1::basic_ostream<char, std::__1::char_traits >&) ()
#10 0x0000000000401403 in main ()

Any ideas?

Aaaand the problem goes away if you compile libc++ with clang.

Sorry for the noise!