[cfe-dev] Name lookup in ObjC methods

Argiris Kirtzidis akyrtzi at gmail.com
Sun Mar 30 18:05:37 PDT 2008

Chris Lattner wrote:
> The second is more interesting for your namespace patch.  I think we 
> really do need an AST-side concept of "scope", which is similar to the 
> parser one, but is also a bit different.  This would allow the 
> implementation of ScopedDecl::isDefinedOutsideFunctionOrMethod to 
> correctly handle typedefs defined inside functions etc.
Just a suggestion, how about a 'DeclContext' AST class that FunctionDecl 
would inherit from (and NamespaceDecl, RecordDecl):

class FunctionDecl : public ValueDecl, public DeclContext {

ScopedDecl would have a DeclContext member and 
isDefinedOutsideFunctionOrMethod would check if it's a FunctionDecl.

More information about the cfe-dev mailing list