C++ classes support (GSoC project) progress report


These are some details about my GSoC project for C++ classes support, what has been delivered and what is coming next, for anyone interested:

Implemented parsing and semantic analysis support (type checking, AST building) for basic C++ classes; to be more specific, classes with:

-nested types (nested classes, typedefs, enums)
-static and non-static data members
-static and non-static member functions
-inline function definitions
-access specifiers

Additional features:

-use of 'this' pointer
-function local classes

This C++ class test case is a good indicator of what is currently supported:

Coming next:

-scope specifier for namespaces and classes:
    namespace N {
        struct C { static int x; };
    void f() { N::C::x = 0; }
      -out-of-line method definitions
    class C {
       void f();
    void C::f() {}

-member access control:
    class C {
        int x;
    void f() {
        C c;
        c.x = 0; // error: 'x' is private

Beyond the GSoC project, I intend to continue improving the C++ classes support, such as:
-support for inheritance:
    -member name lookup that takes into account inheritance chains
    -virtual functions