Re: [sv-ec] Issue 64 / Mantis 2598 - references to parameters in parameterized classes

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Mon Apr 27 2009 - 06:51:05 PDT
Daniel Mlynek wrote:
> Ad 1) but below is legal:
> typedef C this_type;
> this_type::TC i;

Certainly.  But you must be careful to understand that the "C"
here is the default specialization so this_type::TC is not a
reference to TC inside the "parameterized class" but really
is a reference to TC inside the default specialization.

Gord.


> 
> DANiel
> -----Original Message-----
> From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On
> Behalf Of Gordon Vreugdenhil
> Sent: 24 kwietnia 2009 19:15
> To: SV_EC List
> Subject: [sv-ec] Issue 64 / Mantis 2598 - references to parameters in
> parameterized classes
> 
> Mantis 2598 uses the following example:
> 
>    class C #(type TC = int);
>       parameter type LTC = real;
>    endclass
> 
> 
> Question:
> 
>     1) Is "C::TC i;" legal?
> 
>     No -- the first paragraph of 8.24.1 is clear that "::"
>     is not legal for a parameterized class in this context.
> 
>     2) Is "super.TC or super.LTC" legal?
> 
>     No -- at this point the only legal "dotted name" with a
>     type is the interface_name form defined for typedefs in
>     6.18.
> 
>     Note -- I would not object to allowing super.TYPE_NAME
>     as a type reference in the context of a typedef.
> 
>     3) is C#()::TC legal?
> 
>     Yes.  In 8.24.1 we have:
>          When referring to the default specialization as the
>          prefix to the class resolution operator, the explicit
>          default specialization form of #() shall be used.
> 
>     So C#()::TC refers to the type TC within the default
>     specialization of C (i.e. int).
> 
> 
> I don't think we need to take any action here unless there are additional
> questions.
> 
> 
> Gord
> 
> --
> --------------------------------------------------------------------
> Gordon Vreugdenhil                                503-685-0808
> Model Technology (Mentor Graphics)                gordonv@model.com
> 
> 

-- 
--------------------------------------------------------------------
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.
Received on Mon Apr 27 06:53:27 2009

This archive was generated by hypermail 2.1.8 : Mon Apr 27 2009 - 06:54:09 PDT