[cfe-dev] [Patch] AST support, and unqualified name lookup for using-directives

Douglas Gregor dgregor at apple.com
Mon Feb 2 13:24:16 PST 2009


On Feb 2, 2009, at 1:17 PM, Sebastian Redl wrote:

> Douglas Gregor wrote:
>> Is it even possible to have a using directive that nominates an
>> anonymous namespace? I guess it depends on how we implement unnamed
>> namespaces.
>>
>>
>
> I think we should implement them exactly like it says in the  
> standard -
> generate a unique name (preferably containing something that is  
> illegal
> in an identifier) and add the using directive for that namespace. This
> approach means that there is no special casing except when
> pretty-printing, which sounds very attractive to me.

I was thinking that they might just be transparent contexts, but that  
isn't the case. We certainly can't go wrong if we implement the "as  
if" with code exactly modeling the "as if" :)

We actually don't need to give them a name, since the  
UsingDirectiveDecl links to a NamespaceDecl, not the name of a Decl,  
and Piotr already put in the special-case code for printing these  
things. CodeGen can take care of naming anonymous namespaces.

	- Doug



More information about the cfe-dev mailing list