Re: Did anyone ever write out a/the type system for C++ ?

This may not be the exact reference you're looking for but Jon Rossie's
work on "sub-objects" may answer your question.



"John C Mitchell" <mitchell@cs.stanford.edu> on 11/18/99 01:56:51 PM

Please respond to mitchell@cs.stanford.edu

 To:      "Types List" <types@cis.upenn.edu>                  
 cc:      (bcc: Shan Balasubramaniam/Lycos)                   
 Subject: Did anyone ever write out a/the type system for C++ 

[----- The Types Forum, http://www.cis.upenn.edu/~bcpierce/types -----]

Although I am sure there are a lot of groans along the way,
it would be a useful service if someone would write out
the type system for C++ as a set of typing rules, subtype
rules, and whatever other hocus pocus is needed to say
what's really going on. Has anyone done this for an
interesting subset of C++?

At the moment, I am particularly interested in how

   class B : public A { ... }

does (and does not) cause B to be treated as a subtype of A.
In particular, it appears that B <: A follows for r-values
but not for l-values. This makes sense of course, but the
details of how this is applied in type checking look fairly
tricky. In addition B* <: A*, but not B** <: A**, and other
fun stuff.

John Mitchell