Not open source, but has been used to carry out very non-toy massive automated refactoring of C++ programs:
our DMS Software Reengineering Toolkit. DMS is a "library" (we called it a "toolkit") of facilities on can compose to achieve anlaysis and/or automated translation.
Relevant to C++, DMS provides at this point in time:
- Full C++11 parser, constructing the AST and able to regenerate source code accurately
including comments, with a complete preprocessor
- Full C++ parser with name and type resolution for C++ (ANSI, GNU, MS Visual C++)
- Control flow analysis for C++
- Source-to-source transformations
- Partially complete "rename" machinery (see discussion below)
What I can say from experience is that C++ is a bitch of a language to transform.
We continue to work on it, and are completing a reliable renaming tool. Even this is hard; a key problem is the name-shadowing problem. You have a local variable X, and a reference to Y inside that scope; you attempt to rename Y to X and discover that the local variable "captures" the access. It is amazing how many namespaces and capture types you have to worry about in C++. And this is needed as a foundation for many other refactorings.
EDIT Feb 2014: Full C++14 parser, control flow analysis, local data flow analysis