[cfe-dev] using declarations

Douglas Gregor dgregor at apple.com
Mon May 11 10:48:23 PDT 2009


On May 11, 2009, at 10:33 AM, Sebastian Redl wrote:

> Douglas Gregor wrote:
>> Hello John,
>>
>> On Apr 16, 2009, at 5:20 PM, John Thompson wrote:
>>
>>> Question:  When encountering a name corresponding to a using
>>> declaration in an expression, is just substituting the target
>>> declaration okay? I'm worried that losing the semantic information
>>> about an identifier in a statement or expression corresponding to a
>>> using declaration might be an issue.  But just substituting the
>>> target decl makes for simpler code so far.
>>>
>>
>> I think this is the right thing to do, but I suspect that we should  
>> do
>> this substitution of the target declaration much sooner, e.g., as  
>> part
>> of name lookup (in SemaLookup.cpp) when we are not looking for a
>> redeclaration.
>>
>>
>
>
> But we cannot do this for C++0x-style type aliases with the using
> keyword.

Right. We'll want to handle those like typedefs.

> We should probably build a different declaration for those
> anyway, but I feel the name UsingAliasDecl is slightly misleading in
> this case. Why not just UsingDecl?


Fine by me.

	- Doug



More information about the cfe-dev mailing list