I don't see the need for any of these restrictions. The class must be completed before the end of the scope, before any elaboration begins, and there's no ambiguity with identifiers. Dave > -----Original Message----- > From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On > Behalf Of Francoise Martinolle > Sent: Thursday, November 20, 2008 6:48 PM > To: Vreugdenhil, Gordon > Cc: sv-ec@server.eda.org > Subject: RE: [sv-ec] forward typedefs > > > > > If we assume it is legal to do this, can we only use positional > association for the parameter values? > > typedef class c; > > typedef c#(1,1) c_1_1; > typedef c#(.q (1), .p(2)) c_2_1; // is this legal > typedef c#(,1) c_0_1; // can you use default values > > class c #(parameter p = 0, q = 0); > endclass > -----Original Message----- > From: Gordon Vreugdenhil [mailto:gordonv@model.com] > Sent: Thursday, November 20, 2008 7:39 PM > To: Francoise Martinolle > Cc: sv-ec@eda.org > Subject: Re: [sv-ec] forward typedefs > > > This was discussed at some point though I don't recall if it was through > the reflector buried in the wider discussion or just in a meeting. It > certainly wasn't specified in the LRM. > > My recollection was that Mark and I agreed that it would be legal to > have a forward specialization as in your example. > I think that there was some disagreement as to whether the implicit > default specialization using just the name should be allowed. Example: > > typedef class c; > typedef c d; > class c #(parameter p = 0); endclass > > I was somewhat opposed to considering this as legal although it is more > symmetric to allow it. My argument against is mostly one of readability > in terms of intent for a forward type "c#()" used as a forward is more > obvious as to intent. > > Gord. > > > Francoise Martinolle wrote: > > Can you create a class specialization of a class for which we only > > have a forward typedefs? > > > > Is this allowed? > > > > > > typedef class c; > > > > typedef c#(1) c_1; > > > > class c #(parameter p = 0); > > endclass > > > > In mantis 2211, we discussed the usage of :: for incomplete typedefs > > and we speicifed the > > > > following text: > > > > > > A forward typedef shall be considered incomplete prior to the final > > type definition. While incomplete forward > > > > types, type parameters, and types defined by an interface based > > typedef may resolve to class types, use > > > > of the class scope resolution operator (see 8.22) to select a type > > with such a prefix shall be restricted to a > > > > typedef declaration. It shall be an error if the prefix does not > > resolve to a class. > > > > Example: > > > > * * > > > > *typedef *C; > > > > C::T x; // illegal; C is an incomplete forward type > > > > typedef C::T c_t; // legal; reference to C::T is made by a typedef > > > > c_t y; > > > > * * > > > > *class *C; > > > > * * > > > > *typedef *int T; > > > > * * > > > > *endclass* > > > > > > -- > > This message has been scanned for viruses and dangerous content by > > *MailScanner* <http://www.mailscanner.info/>, and is believed to be > > clean. > > -- > -------------------------------------------------------------------- > Gordon Vreugdenhil 503-685-0808 > Model Technology (Mentor Graphics) gordonv@model.com > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. > -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Thu Nov 20 21:55:03 2008
This archive was generated by hypermail 2.1.8 : Thu Nov 20 2008 - 21:55:10 PST