From 7931274501700764430
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,a5e7fc89a8659411
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-07-21 11:33:57 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: do-not-spam-benh@bwsint.com (Ben Hutchings)
Newsgroups: comp.std.c++
Subject: Re: Voided application of indirection operator to pointer-to-void
Date: Mon, 21 Jul 2003 18:33:57 +0000 (UTC)
Lines: 37
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <slrnbho5vh.18k.do-not-spam-benh@tin.bwsint.com>
References: <5765b025.0307210232.6c571eff@posting.google.com>
X-Trace: mail2news.demon.co.uk 1058812437 12915 10.0.0.1 (21 Jul 2003 18:33:57 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Mon, 21 Jul 2003 18:33:57 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.12)
	id 19efTv-0003MA-00
	for mail2news@news.news.demon.net; Mon, 21 Jul 2003 18:33:56 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id EAA02249; Tue, 22 Jul 2003 04:33:53 +1000 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ucar.edu
X-Newsgroups: comp.std.c++
X-Reply-To: Ben Hutchings <benh@bwsint.com>
X-Orig-NNTP-Posting-Host: gold.businesswebsoftware.com (195.74.108.82)
X-Orig-X-Trace: news.uni-berlin.de 1058805733 15477815 195.74.108.82 (16 [70929])
X-User-Agent: slrn/0.9.7.4 (Win32)
X-Spam-Status: No, hits=-4.1 required=5.0
	tests=AWL,BAYES_01,EMAIL_ATTRIBUTION,QUOTED_EMAIL_TEXT,
	      REFERENCES,REPLY_WITH_QUOTES,USER_AGENT
	version=2.55
X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
Xref: archiver1.google.com comp.std.c++:20254

In article <5765b025.0307210232.6c571eff@posting.google.com>, Al Grant wrote:
> Is this legal C++?
> 
>   void f(void *pv) { *pv; }
> 
> Comeau and g++ both fault it.  5.3.1 says the operand of * must be T*
> where T is an object type or function type - so not void.
<snip>
> However, we have another source claiming the code is legal, citing 4.1
> as showing an intention to allow (undereferenced) lvalues of incomplete
> type and deducing that if 5.3.1 forbids this it is an oversight.
> 
> It seems to me that 4.1 only implies that lvalues of some incomplete
> types may exist,

You are quite right.  There are no lvalues of void type (3.10p2).

> and 5.3.1 indicates that those generated by the indirection operator
> must have an object type.

Or function type.

> I can believe that the committee might have intended to allow creation
> of void lvalues, motivated either by orthogonality, or by compatibility
> with C.
<snip>

I very much doubt it; I can't see that it would be meaningful to have a
void lvalue, and I don't believe C allows it either.  (void rvalues do
exist in both C and C++, though.)

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]



