Re: [sv-ec] Class static member initialization

From: Steven Sharp <sharp_at_.....>
Date: Thu Oct 30 2008 - 14:04:46 PDT
>> 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 ?

Actually, these are slightly different issues.  Mantis 2372 deals with
const variables, rather than const class properties.

The restriction on const class properties is stronger than the restriction
on const variables. The BNF for an initializer on a const class property
requires a constant_expression.  This does not allow hierarchical references
or references to const variables, which are allowed on initializers for
const variables.

Both sets of restrictions appear to be similar in serving no useful purpose.

Steven Sharp
sharp@cadence.com


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Oct 30 14:05:51 2008

This archive was generated by hypermail 2.1.8 : Thu Oct 30 2008 - 14:06:20 PDT