RE: [sv-bc] Question on pure virtual function

From: Brad Pierce <Brad.Pierce_at_.....>
Date: Tue Oct 07 2008 - 15:42:40 PDT
The Note in 6.18 of Draft 7 says "[...] an empty user-defined type
declaration [...] cannot be used for coupled definitions of structures".

-- Brad

-----Original Message-----
From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
Gordon Vreugdenhil
Sent: Tuesday, October 07, 2008 1:36 PM
To: Steven Sharp
Cc: spsaha@cal.interrasystems.com; sv-bc@eda.org
Subject: Re: [sv-bc] Question on pure virtual function


I'd be fine with making that illegal since there really isn't
any good reason for doing it.  But at a conceptual level
it isn't really different than derivation from a type
parameter (another incomplete type) so I don't have a deep
philosophical basis for making it illegal.

Similarly with struct fields, should something like the
following be legal?
    typedef S1;
    typedef struct {
                S1 s;
            } S2;
    typedef struct { int i; } S1;

I think that it probably is legal in the current LRM,
particularly given that some stronger restrictions about
forward typedefs were rejected, so I suspect that all
of this is legal.

Gord.


Steven Sharp wrote:
>> Well, there generally isn't a very good reason to have the
>> base class defined after the derived class in the same section
>> of code so I would consider that to be at least bad style.
> 
> That "at least" suggests that you might consider it to be invalid
code.
> Has there been discussion of whether it should be illegal to derive
> from a base class for which you have only seen a forward declaration?
> 
> Steven Sharp
> sharp@cadence.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.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Oct 7 15:44:08 2008

This archive was generated by hypermail 2.1.8 : Tue Oct 07 2008 - 15:44:52 PDT