Re: [sv-bc] void in an actual expression?

From: Gordon Vreugdenhil <gordonv_at_.....>
Date: Thu Nov 01 2007 - 13:42:52 PDT
Steven Sharp wrote:
[...]
>> There are no rules for how to treat void values in an expression.  A
>> void function call in an expression would be illegal.  Therefore, I
>> would have to conclude that a reference to a void member of a tagged
>> union is not a legal expression, and cannot be used in one.  

I would agree.

"void" is not a type -- it is the absence of a type.


 >> A tagged
>> union with only one member (and thus no need for a tag), and the one
>> member being void, would also need to be dealt with.  I would conclude
>> that either its declaration is illegal in the first place, or a reference
>> to the union as a whole is still considered a void value and is not an
>> expression.  Alternately, a void could be considered an expression but
>> not of integral type, and therefore unusable in an integral expression.


We could change the rules and say that in all cases a
tag will consume at least one bit.  That does mean that a
trivial (single element) tagged union would no longer be identical
to previous potential interpretations, but I don't know if I
consider that an issue.  I don't know that I've seen real code
that relies on that.  Such an approach would also mean that you couldn't
end up with a 0-bit packed tagged union.

Gord
-- 
--------------------------------------------------------------------
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 Thu Nov 1 13:43:14 2007

This archive was generated by hypermail 2.1.8 : Thu Nov 01 2007 - 13:43:24 PDT