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

James Porter porterj at alum.rit.edu
Fri Jul 10 10:11:46 PDT 2009


Douglas Gregor wrote:
> Since the conversion-function-id is the only place where I could imagine 
> your approach and my suggestion to differ, and in theory we have to do 
> *both*, let's go with your approach: it requires fewer changes, and we 
> can think about diagnosing paragraph 7 later.

I've actually already changed to your original suggestion, since it 
cleans things up a bit so that I'm not rechecking the underlying types 
of the operations quite so often. I haven't posted it to the list yet 
because I'm not done yet, and I want to write up some more tests 
(especially for overloaded operator->, which I had to change a bit).

It's also possible that a different approach entirely will be required, 
since in addition to paragraph 7, paragraph 6 also has some strange 
rules for name lookup:

"If the nested-name-specifier contains a class template-id (14.2), its 
template-arguments are evaluated in the context in which the entire 
postfix-expression occurs."

I'm almost certain that my patch will fail on this case, since it'll be 
lookup up the template-arguments in the class's context as well. I have 
a feeling that there's a solution that will handle both of these.

Incidentally, I think it's possible to cause the same issue you 
mentioned about [basic.lookup.classref]p7 with *any* qualified-id (p4). 
I'll see if I can write up a test that reveals this. The important part 
will be ensuring that identifier A refers to a (base) class in the class 
context and a namespace in the expression context. It'll probably work 
the same way with either approach, though.

- Jim




More information about the cfe-dev mailing list