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.Received on Tue Oct 7 14:56:20 2008
This archive was generated by hypermail 2.1.8 : Tue Oct 07 2008 - 14:57:17 PDT