[cfe-dev] WIP patch for qualified-ids in class member access

James Porter porterj at alum.rit.edu
Fri Jul 10 23:37:02 PDT 2009

I've updated my patch (attached). The main change is that this version 
supports qualified-ids with overloaded operator->. Other than that, most 
of the changes are merely organizational.

Douglas Gregor wrote:
> Oh, great! I was afraid that my original suggestion would have made it  
> uglier. I'm happy with whatever is clean :)

Yeah, honestly my original code was organized that way just because 
that's how it looked when I had hacked the feature when I was still 
trying to figure out what was going on. That's where my curious use of 
passing ExprArg by reference came from too. :)

That said, the new patch has a few things that are less-than-clean, like 
how I handle overloaded operator->, which needed to happen before 
parsing the nested-name-specifier, so it got moved into 

> Ah, right. There's similar wording in [class.qual]p1 when parsing  
> nested-name-specifiers (that aren't for class member access), but in  
> that case we don't try to "enter" the context of the class/namespace  
> in the nested-name-specifier, so we should get this right. Perhaps  
> that's what we missed: maybe we need special name-lookup routines for  
> the identifier that follows the -> (to deal with all of those weird  
> semantics), rather than trying to enter a different context.

That's what I'm thinking. Currently (Enter|Exit)DeclaratorContext is a 
black box to me, and I've just been using it because it "works", 

- Jim
-------------- next part --------------
A non-text attachment was scrubbed...
Name: qualified-ids.patch
Type: text/x-patch
Size: 13148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090711/e131f20b/attachment.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: qual-id-test.cpp
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090711/e131f20b/attachment.ksh>

More information about the cfe-dev mailing list