Re: [sv-bc] Name resolution and unknown types

From: Greg Jaxon <Greg.Jaxon_at_.....>
Date: Wed Jun 20 2007 - 13:39:18 PDT
Gordon Vreugdenhil wrote:
> 
> 
> 
> ------------------------------------------------------------------------
> 
> This is particularly intended for the people involved in name 
> resolution discussions but may be of general interest.
> 
> In the course of discussion some EC issues related to 
> parameterized classes recently, I took some time to look more
> carefully at exactly what the C++ standard says about name
> resolution in the context of templates.  It was quite 
> interesting.
> 
> I would strongly recommend that people looking at SV name
> resolution should read 14.6 in the ISO/IEC 14882 C++ spec 
> (I used the 1998(E) version).  In particular 14.6.2 talks
> about "dependent names" and following sections talk about
> "type-dependent expressions" and similar.
> 
> There is a very strong correlation between the handling of
> "dependent names" and what I have been trying to suggest
> in terms of how SV name resolution should be handled when
> names with unknown types are encountered.  There are also
> some very interesting scenarios in C++ in which name
> binding within templates doesn't happen in quite the way
> that one might expect (nor in the manner that some compilers
> still implement).  The rationales for the latest versions
> of the C++ rules appear to revolve around various 
> inconsistencies and underdefined situations when complex
> ambiguities are present. 
> 
> Although I don't think we can just "port" the C++ rules
> to SV due to other interacting issues such as hierarchical
> name resolution, I think that we should definitely pay
> some close attention to what C++ has done since they have
> been working through the resolution rules for years with
> many more resources that we have.  Ignoring their experience
> would likely lead us to rediscover some of the same issues
> over time and I'd rather try to leverage their work to
> get close(r) to a good solution earlier.
> 
> 
> Here are a couple of relevant links that talk about some
> of the issues and edge case behavior.
>    http://msdn2.microsoft.com/en-us/library/19cbwccf(VS.80).aspx
That's a pretty good survey of the issue.

>    http://www.parashift.com/c++-faq-lite/templates.html#faq-35.18
Fortunately SV avoids this ambiguity because typenames and data member
names come from the same namespace.  The claim that there /could/ be a
specialization where B<Foo>::Xyz is a data member is false in the SV
language.

https://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gcc/c---misunderstandings.html
Use this link to avoid https:
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gcc/c---misunderstandings.html#NAME-LOOKUP

There is also argument-dependent name lookup, not directly concerned with templates,
but quite important for template expression programming:
http://en.wikipedia.org/wiki/Argument_dependent_name_lookup

http://www.hlrs.de/organization/tsc/services/tools/docu/kcc/UserGuide/chapter_9.html#koenig-lookup



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Jun 20 13:39:38 2007

This archive was generated by hypermail 2.1.8 : Wed Jun 20 2007 - 13:40:04 PDT