<div dir="ltr">I got some very simple code, dumbed down from a larger one:<div><br></div><div><div>[~]> cat wc.cpp </div><div>#include <iostream></div><div><br></div><div>int wc() {</div><div>    return 0;</div><div>}</div><div><br></div><div>int main()</div><div>{</div><div>    std::cout << wc() << std::endl;</div><div>}</div></div><div><br></div><div>[~]> /opt/clang/bin/clang++ -stdlib=libc++ -fsanitize=undefined wc.cpp</div><div><div>[~]> ./a.out                                                         </div><div>/opt/clang/bin/../include/c++/v1/ostream:1034:14: runtime error: member call on address 0x000000ef9858 which does not point to an object of type 'std::__1::basic_ios<char>'</div><div>0x000000ef9850: note: object is base class subobject at offset 8 within object of type 'std::__1::basic_ostream<char, std::__1::char_traits<char> >'</div><div> 00 00 00 00  40 a3 b9 c6 b1 7f 00 00  68 a3 b9 c6 b1 7f 00 00  02 10 00 00 00 00 00 00  06 00 00 00</div><div>              ^                        ~~~~~~~~~~~~~~~~~~~~~~~</div><div>                                       vptr for '<unknown>' base class of 'std::__1::basic_ostream<char, std::__1::char_traits<char> >'</div><div>/opt/clang/bin/../include/c++/v1/ios:734:41: runtime error: member call on address 0x000000ef9858 which does not point to an object of type 'std::__1::ios_base'</div><div>0x000000ef9850: note: object is base class subobject at offset 8 within object of type 'std::__1::basic_ostream<char, std::__1::char_traits<char> >'</div><div> 00 00 00 00  40 a3 b9 c6 b1 7f 00 00  68 a3 b9 c6 b1 7f 00 00  02 10 00 00 00 00 00 00  06 00 00 00</div><div>              ^                        ~~~~~~~~~~~~~~~~~~~~~~~</div><div>                                       vptr for '<unknown>' base class of 'std::__1::basic_ostream<char, std::__1::char_traits<char> >'</div><div>0</div></div><div><br></div><div><br></div><div>Works fine if I link to libstdc++. clang is r223341.</div><div><br></div></div>