[cfe-dev] C++ classes support (GSoC project) progress report

Argiris Kirtzidis akyrtzi at gmail.com
Sat Jul 12 15:55:41 PDT 2008


Hi,

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:
https://llvm.org/svn/llvm-project/cfe/trunk/test/Sema/cxx-class.cpp


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 {
    private:
        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


-Argiris



More information about the cfe-dev mailing list