Re: [sv-bc] parameterized structures

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Thu Jun 22 2006 - 07:22:43 PDT
Bresticker, Shalom wrote:

> Brad has filed Mantis 1511 on $typename for specializations of 
> parameterized classes.

There are other problems with $typename.

Here are a few issues that are easy to identify:
   1) "22.2 c)" says that anonymous types receive a system generated name.
      The format of that name is not specified.
   2) "22.2 e)" does not define the exact form of printed values for enums.
   3) "22.2 f)" says that types are prefixed with their scope name.  Is that the
      full hierarchical path or the lexical path (ie. like %m)
   4) "22.2 g)" says that array ranges are represented as unsized decimal
      numbers.  What happens with associative or dynamic arrays?
   5) Are non-equivalent named types from different compilation units
      (ie different $unit scopes) distinguishable from each other?
   6) Are type parameters named by the type parameter?  Are they structurally
      expanded?  If I have:
         typedef struct { int a; } T1;
         typedef T1 T2;
      Does $typename(T2) yield "T1" or the struct form of T1?
   7) The sentence "Thus $typename can be used in string comparisons for
      stricter type comparison of arrays than with type references." implies
      that no non-equivalent types ever have the same string.  This
      interacts with (5) above.  It also implies that exact form is
      important -- including spaces, etc.  This needs a precise specification.
   8) The form for structs and enums is not explicitly defined.
   9) Class types are not addressed.  Are they printed just by name or
      as in an expanded "struct" like form?
  10) Self-referential class types are not addressed.  If classes are printed
      in expanded form, self-referential types have an infinite print form.
  11) In terms of specializations, do you get the name of the location of the
      specialization or a name that is unique to the specialized type?
      example:
          C #(1) c_1;
          C #(1) c_2;
      Is it true/not true that $typename(c_1) == $typename(c_2) ?
  12) Are matching types supposed to have the same string?  I.e. if two types
      match, is one guaranteed that the $typename form is identical?


I've attached the above to 1511.

At this point $typename appears to be very underspecified in
the LRM and is not implementable in a manner that would be
consistent across vendors without significant clarification.

Gord.

-- 
--------------------------------------------------------------------
Gordon Vreugdenhil                                503-685-0808
Model Technology (Mentor Graphics)                gordonv@model.com
Received on Thu Jun 22 07:22:57 2006

This archive was generated by hypermail 2.1.8 : Thu Jun 22 2006 - 07:23:20 PDT