From 2621108139763827393
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,aa804c06bdf2b5a5
X-Google-Attributes: gidf78e5,public
From: James Kanze <james-albert.kanze@vx.cit.alcatel.fr>
Subject: Re: || and && with void argument (was: Proposal fix: [i,j] => [i;j])
Date: 1996/12/26
Message-ID: <rf5ybelpoix.fsf@vx.cit.alcatel.fr>#1/1
X-Deja-AN: 206063464
references: <58c7b4$ohk@toralf.uib.no>
x-original-date: 26 Dec 1996 11:51:02 +0100
organization: -
x-auth: PGPMoose V1.1 PGP comp.std.c++
newsgroups: comp.std.c++
originator: austern@isolde.mti.sgi.com
x-mailer: Gnus v5.3/Emacs 19.34


Alexandre Oliva <oliva@dcc.unicamp.br> writes:

|>  By the way, what is the type of a throw expression?  Is it void?

Presumably, the same type as a delete expression:-).

Actually, there is a hint that a throw expression should be of type
void, in 5.16: "[Concerning conditional operator...] Both the second and
the third operands have type void; the result is of  type void and is an
rvalue.  [Note: this includes the case where both operands are
throw-expressions.]"  (I'm not sure if the note is normative, but it
certainly would be indicative of the intent of the standards committee.)

Logically, I think that both throw and delete should have void type.
Practically, it would be nice if this were explicit in the standard.  (I
think that adding words to this effect would qualify as a simple
clarification, and should not delay the standardization process.)

|>  The Nov'96 DWP says [except.throw]:
|>  
|>  2 [...] The type of
|>    the throw-expression shall not be an incomplete type, or a pointer  or
|>    reference  to  an  incomplete  type,  other  than  void*, const void*,
|>    volatile void*, or const volatile void*.
|>  
|>  But I guess it's actually referring to the expression just after the
|>  keyword "throw", not to the type of the evaluated throw expression
|>  (which is never available anyway).

I'm almost certain of this, but it is sloppy wording.  The term
throw-expression is part of the grammar, where it very definitly does
mean the entire expression, including the "throw" keyword.

-- 
James Kanze         home:     kanze@gabi-soft.fr        +33 (0)3 88 14 49 00
                    office:   kanze@vx.cit.alcatel.fr   +33 (0)1 69 63 14 54
GABI Software, Sarl., 8 rue des Francs Bourgeois, F-67000 Strasbourg, France
	      -- Conseils en informatique industrielle --
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your 
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu 
]



