[cfe-dev] Parsing MFC code with clang - some info of coming works

Francois Pichet pichet2000 at gmail.com
Sun May 8 17:25:28 PDT 2011


Here is a small update regarding my work to patch clang to make it
capable of parsing MFC code.

I created a MFC project using MSVC 2008 and I clicked on every
possible option to pull as much header files as possible. The result
.exe is a good looking Office-like executable with Ribbon and
everything.
Then I have a small .sln and .vcproj parser where I extract the list
of source files with the proper option necessary for parsing (mostly
include path and define list )

I then call clang on each file and I look at the result.
Right now, there are about a dozen problems preventing clang to parse
the MFC project. Most are small problems that will require minimal
work


But then there are 2 issues that will be more challenging and I plan
to work on them in the coming weeks.


1. Allow to specialize a function within class scope.
Example:
class A {
    template<typename T> _com_ptr_t(T* p)
    {
    }

    template<> _com_ptr_t(char* str)
    {
    }
};


2. Unqualified lookup into dependent bases of class templates
Info here: http://clang.llvm.org/compatibility.html#dep_lookup_bases

This one is causing the majority of compile errors when parsing MFC
code with clang.
I admit trying to implement this one scare me a little..

happy hacking..



More information about the cfe-dev mailing list