Problematic clang code generation with -O0
问题 The following snippet: #include <string> #include <iostream> int main() { std::string s = std::to_string(5); std::cout << s << std::endl; return 0; } Fails to link with Clang 3.6 on windows (accompanied with gcc 4.8.2 headers and libraries) when given the following options: clang++ -std=c++11 -static -O0 bug.cpp Please note that with -O2 the snippet compiles and links fine, so i suspect it may be some kind of clang bug. EDIT 1: I forgot to put the link error: F:/Programs/LLVM/bin/../lib/gcc