Re: [sv-ec] Class static member initialization

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Thu Oct 30 2008 - 13:36:03 PDT
Steven,

> Oddly, an initializer on a class const member is required to be a
constant
> expression, which suggests that it would be a constant function call
in
> that context.  Personally, I think this is a stupid rule.  There is no
> reason why a constant expression should be required in this context.

This is the issue of http://www.eda-stds.org/svdb/view.php?id=2372 ?

-- Brad

-----Original Message-----
From: owner-sv-ec@eda.org [mailto:owner-sv-ec@eda.org] On Behalf Of
Steven Sharp
Sent: Thursday, October 30, 2008 12:45 PM
To: Mark.Hartoog@synopsys.COM; sv-ec@eda.org; Dave_Rich@mentor.com
Subject: RE: [sv-ec] Class static member initialization


>From: "Rich, Dave" <Dave_Rich@mentor.com>

>It should print nothing.:-( 13.4.3 says:
>
>" - All system task calls within a constant function shall be ignored."

An initializer on a class static member is not required to be a constant
expression, therefore this is not a constant function call.

Oddly, an initializer on a class const member is required to be a
constant
expression, which suggests that it would be a constant function call in
that context.  Personally, I think this is a stupid rule.  There is no
reason why a constant expression should be required in this context.
The
only rationalization I can see is to try to make "global const" members
have the same value in all instances.  If you want that, you can declare
it
static.  The rule also complicates the BNF.  One side effect of that
complication is that you cannot declare a const class member that is a
virtual interface.

Steven Sharp
sharp@cadence.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 Oct 30 13:37:49 2008

This archive was generated by hypermail 2.1.8 : Thu Oct 30 2008 - 13:38:27 PDT