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

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Tue Apr 15 2008 - 06:55:25 PDT
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)?

Gord
-- 
--------------------------------------------------------------------
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 Tue Apr 15 06:55:53 2008

This archive was generated by hypermail 2.1.8 : Tue Apr 15 2008 - 06:56:22 PDT