Using simple source code:
$ cat /tmp/string.cpp #include <string> int main() { std::string a("a"); a = std::to_string((float)1); return a.length(); }
With clang::ASTFrontendAction::ExecuteAction() the next assertion bails:
/src/oss/clang/lib/Sema/SemaDecl.cpp:10637: clang::Decl* clang::Sema::ActOnFinishFunctionBody(clang::Decl*, clang::Stmt*, bool): Assertion `MaybeODRUseExprs.empty() && "Leftover expressions for odr-use checking"' failed.
But if I compile the same source using clang++ everything is fine, because size_t is defined there, while if I use ASTFrontendAction size_t is not defined, and if you will ignore errors, than it will bail in ActOnFinishFunctionBody().
Anyway, I've digged this, and got simple regression test for this.
I guess that this could be not the correct fix, but this how I fixed this in a few days.
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2015-February/041726.html