Something strange is happening while parsing using

std::unique_ptr<ASTUnit> au = clang::tooling::buildASTFromCodeWithArgs(code, arguments, llvm::Twine(argv[i]));

I get a lot of errors and warning written to stderr (how can I stop that
apart from redirecting fd 2 to /dev/null?) but the following does not
return anything:

for(ASTUnit::stored_diag_const_iterator iterator = au -> stored_diag_begin(); iterator != au -> stored_diag_end(); iterator++) {
// etc

Folkert van Heusden