[sv-bc] Name resolution and unknown types

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Wed Jun 20 2007 - 08:00:12 PDT
-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


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
   http://www.parashift.com/c++-faq-lite/templates.html#faq-35.18
   https://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/gcc/c---misunderstandings.html

Gord.
-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com
Received on Wed Jun 20 08:00:30 2007

This archive was generated by hypermail 2.1.8 : Wed Jun 20 2007 - 08:00:55 PDT