RE: [sv-bc] Can aggregation be used in a dynamic array "new" initializer?

From: Bresticker, Shalom <shalom.bresticker_at_.....>
Date: Tue Apr 15 2008 - 07:07:48 PDT
A justification for legality is that assignment-like contexts include
"The passing of a value to a subroutine input, output, or inout port",
and new() is a method, which is a subroutine.

Shalom 


> Should the following be legal?
> 
>     int a[];
>     initial
>        a = new[2]('{5,7});
> 
> The aggregate is not really in an assignment like context and 
> the type of the target is (at best) indirect.  If this should 
> be legal, is it equivalent to:
> 
>     typedef int T[];
>     int a[];
>     initial
>        a = new[2](T'{5,7});
> 
> or
> 
>     typedef int T[2];
>     int a[];
>     initial
>        a = new[2](T'{5,7});
> 
> It would make a difference if the aggregate in this case was, 
> for example, '{5,6,7} instead of '{5,7} since the type "int 
> T[2]" would cause an error.
> 
> I think that users would likely expect this to be legal and, 
> given that, I think the implied type should be the dynamic 
> array type.  However, it is not clear to me that the LRM allows this.
> 
> So, is there consensus that this should be legal?  If so, 
> does anyone have any opinion about what to appeal to in the 
> LRM to claim legality (or not)?
---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Apr 15 07:09:02 2008

This archive was generated by hypermail 2.1.8 : Tue Apr 15 2008 - 07:09:18 PDT