clang api in qt5.2

I'm a novice developer, use clang api for astdump. I use
clang-check --version
  LLVM version 3.4
  Optimized build.
  Built Jul 31 2013 (18:59:40).
  Default target: x86_64-pc-linux-gnu
  Host CPU: core-avx-i

but as I can not get through ast.
here is my code,

#include <QCoreApplication>
#include <vector>
#include <iostream>
#include <QDebug>
#include <clang/Basic/Diagnostic.h>
#include <clang/Basic/DiagnosticOptions.h>
#include <clang/Frontend/CompilerInstance.h>
#include <clang/Frontend/CompilerInvocation.h>
#include <clang/Frontend/Utils.h>
#include <clang/Frontend/ASTUnit.h>
#include <clang/Frontend/TextDiagnosticBuffer.h>
#include <clang/Frontend/VerifyDiagnosticConsumer.h>
#include <clang/Frontend/FrontendActions.h>

using namespace clang ;
using namespace llvm ;

int main(int argc, char *argv[])
    QCoreApplication a(argc, argv);
    DiagnosticOptions* diagOpts = new DiagnosticOptions();
        CodeGenOptions* codeGenOpts = new CodeGenOptions();
        CompilerInstance compiler;
        ); // to stdout
        const char *args[] =
            "-cc1", // вызов LLVM Clang
            "a.cpp" // входной файл

            args + 2,
            assert(0 == compiler.getDiagnostics().getErrorsAsFatal());
            FrontendAction *action = new ASTDumpAction;
                std::cout << "ok:";
                std::cout << "error:";
        std::cout << "8" << std::endl;
            assert(0 == compiler.getDiagnostics().getNumWarnings());
    return a.exec();

please do not abuse for the code and my English

I’d suggest to use libtooling ( instead of setting up your own compiler instance.