I am trying out Clang (version 3.4, via the Windows pre-built binaries) to see if it could be a suitable replacement for GCC (version 4.8.1, using MinGW); however, I am unable to get a simple program to work.
#include <iostream>
int main()
{
std::cout << std::endl;
}
Clang is able to compile and link the program, but running it results in a SIGSEGV
signal and a return code of 0xC0000005
. Outputting a string works fine, but std::flush
causes the same result, though allowing the stream to automatically flush itself is okay.
Debugging the program just shows a call stack containing __mingw_CRTStartup()
(Clang is using libstdc++, as it didn't install libc++) and std::cout ()
. What might be causing this, and how could it be fixed?
edit: The same thing happens when using other ostream manipulators such as std::dec
and std::unitbuf
.