help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: %union errors that shouldn't be there


From: Hans Aberg
Subject: Re: %union errors that shouldn't be there
Date: Tue, 22 Mar 2005 14:38:56 +0100

At 10:39 +0100 2005/03/22, Laurence Finston wrote:
On Mon, 21 Mar 2005, Hans Aberg wrote:

 They should be OK in C++, as pointers do not have non-trival
 con-/de-structors. The compiler needs to see a declaration of the
 name as a type, though, before it sees the pointer.

If I remember correctly, it has to do with the size of the objects not
being known at the time the `union' declaration is compiled.  I'm not
sure, but I think I tested this once and discovered, somewhat to my
surprise, that using pointers in the `union' didn't work, either.  When I
get a chance, I'll check this carefully.

With unions, the problem is, if con-/de-structors are non-trivial, that it is impossible to know which ones to apply and when. The union does not contain any type information which field is selected. If one adds that, unions with non-trivial con-/de-Structors would be possible.
--
  Hans Aberg




reply via email to

[Prev in Thread] Current Thread [Next in Thread]