[cfe-dev] Ideas for member access

Douglas Gregor dgregor at apple.com
Sun Feb 8 10:14:01 PST 2009


On Feb 8, 2009, at 7:57 AM, Sebastian Redl wrote:
> It seems that, after templates, the only big C++ feature that's far  
> from
> complete is member access checking. So I'd like to know if anyone has
> already thought about this and has some design ideas.


My only thought about member access checking is that we can safely  
ignore it for a quite a while longer, if we want to, since a well- 
formed C++03 program can still compile even if we don't do any access  
checking. Friends, on the other hand, have an impact on name lookup,  
so we can't ignore friend declarations as long.

That said, I think part of the design for access checking is going to  
need the ability to either store a list of access checks that still  
need to be performed, or to be able to walk over an AST and perform  
access checking later. This is required for, e.g., out-of-line member  
definitions:

   class X {
     typedef int type;

   public:
     type f();
   };

   X::type X::f() {  // delay access checking of X::type until we know  
that we're defining a member function within 'X'
   }

	- Doug



More information about the cfe-dev mailing list