On Apr 2, 2008, at 8:55 AM, Ted Kremenek wrote:

> All of this makes a lot of sense to me.  I like the unifying concept
> of context here, from the TranslationUnit level and down, and I like
> having NamespaceDecls having an enclosing context, etc., so that one
> can easily traverse the namespace hierarchy.  I'm curious, how would
> the following be handled:
>
>   namespace foo {
>     class F {  public:  void foo(); };
>   }
>
>   using namespace foo;
>
>   void F::foo() {}
>
> What would the "ContextDecl" be for the decl representing the
> definition of foo?  Would it be a NamespaceDecl, or a
> TranslationUnitDecl?  If it is a NamespaceDecl, is it the same
> NamespaceDecl as the one enclosing the class definition?  I'm sorry if
> this has already been discussed; I'm trying to wrap my mind around
> what exactly a ContextDecl is, as it seems to represents both a
> syntactic construct and a language concept.

I think I understand this better.  NamespaceDecl doesn't have a direct  
syntactic mapping, but represents a concept.  Also, the ContextDecl  
for the method definition of foo would be its ClassDecl, not the  
NamespaceDecl.
_______________________________________________
cfe-dev mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Reply via email to