[cfe-dev] Patch for C++ namespaces

Chris Lattner clattner at apple.com
Sun Apr 20 18:30:06 PDT 2008


On Apr 20, 2008, at 4:52 PM, Argiris Kirtzidis wrote:

>>> By reporting 2 namespace decls, the AST maps to the source code  
>>> better, and a refactoring tool would be able to do (for example)  
>>> "rename all 'A' namespaces" by traversing the AST.
>>>
>>> If this sound reasonable, how about adding a OriginalNamespace  
>>> member to NamespaceDecl so that extended namespace definition  
>>> decls point to the 'original' one?
>>
>> I think we should tackle this in a more systematic way.  All  
>> "merging" of decls should be treated the same.  It really would be  
>> nice to be able to walk all declarations of some decl.
>
> A unified way to walk all 'merged' declaration would be great. How  
> about I commit namespaces as it is (minus NamespaceScope), so that a  
> way to deal generally with merged decls would
> consider NamespaceDecls too.
>

Makes sense to me!  Note that Doug's recent patch proposes a way to  
handle merging, but it is (currently) specific to functiondecls.

-Chris



More information about the cfe-dev mailing list