Boost logo

Boost :

Subject: [boost] clang AST based static analysers - Booster's experience
From: Niall Douglas (ndouglas_at_[hidden])
Date: 2013-07-23 12:57:27

Dear Boost Devs,

I was wondering what the experience of the list is with clang AST based
static analysers? They need not be clang AST based of course, so long as
they are based on the frontend of a real compiler rather than trying their
own implementation based on regex or something even worse.

For this list's information, here are the three clang AST based static
analysers I know of:

1. Clang's static analyser

2. OCLint

3. The commercial tool CppDepend can now use a clang AST

Some quick notes of mine which may be of dubious accuracy:

Clang's static analyser is the more mature tool, but according to which was updated
Mar 2013 it feels its default bundled C++ tests is lacking. The real
strength in the clang static analyser is for writing your own tests
( which enforce
specific coding patterns or constraints (usually on others, and usually
pre-commit with commit rejection if fail).

OCLint is a newer tool, but appears to have fuller support for C++
(, though many of those rules
appear to check C syntax only (which also covers Objective C). Similar to
clang's static analyser, new custom rules are easy to write
( This project, at least
from the outside, seems to have more legs than clang's static analyser.

CppDepend I have no experience of, but there is a reasonably positive review
at One of the CppDepend
developers talks about how they added clang's AST at


Opinions expressed here are my own and do not necessarily represent those of
BlackBerry Inc.

Boost list run by bdawes at, gregod at, cpdaniel at, john at