From 8171331374210777522
X-Google-Thread: f78e5,60dc9044ee8e77d3
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news1.google.com!news2.google.com!proxad.net!proxad.net!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: AlbertoBarbati@libero.it (Alberto Barbati)
Newsgroups: comp.std.c++
Subject: Re: Strange new/new() problem
Date: Sat, 22 Jan 2005 03:47:48 GMT
Organization: [Infostrada]
Lines: 36
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <tG6Id.2117$V17.55312@twister1.libero.it>
References: <41ec486b$1@solnews.wv.mentorg.com> <1106064562.182462.247340@c13g2000cwb.googlegroups.com>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.demon.co.uk 1106365675 5010 158.152.254.254 (22 Jan 2005 03:47:55 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sat, 22 Jan 2005 03:47:55 +0000 (UTC)
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en, it
X-Virus-Scanned: by amavisd-new at cs.mu.OZ.AU
X-Path: comp-std-cpp-robomod!not-for-mail
X-Received: (from fjh@localhost)
	by mulga.cs.mu.OZ.AU (8.12.10+Sun/8.12.9/Submit) id j0M3lmAR012240;
	Sat, 22 Jan 2005 14:47:48 +1100 (EST)
X-NNTP-Posting-Date: Fri, 21 Jan 2005 13:35:37 MET
X-Enigmail-Supports: pgp-inline, pgp-mime
X-Enigmail-Version: 0.89.6.0
X-Delivered-To: std-c++@ucar.edu
X-Spamscanner: mailbox8.ucsd.edu  (v1.5 Dec  3 2004 17:34:44, 0.0/5.0 3.0.0)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
X-MailScanner: PASSED (v1.2.8 1926 j0LCZfPS011544 mailbox8.ucsd.edu)
Xref: g2news1.google.com comp.std.c++:3936

kanze@gabi-soft.fr wrote:
> "Fedor G. Pikus" wrote:
> 
> 
>>and did what the programmer wanted, but several other
>>compilers refused.  Error messages are of two types: either
>>it's "cannot assign data* to data**" or "[5] is unexpected".
> 
> The latter is only a warning, I hope.
> 
> <snip>
> 
> One could argue for a special rule barring the immediate
> application of [] to the results of a new expression -- I can't
> think of a case off hand where it is useful.  Orthogonality
> would argue against such a hack, of course, but that shouldn't
> be the only consideration.
> 

According to the interpretation I gave in my other post, the compiler 
should indeed give an error, not a warning. There's no need for a 
special rule to bar the application of [] to the result of new, because 
it seems to me that the current rules already make such application 
ill-formed. That's because [] operates on a postfix-expression and "new 
(data*)" is not a postfix-expression.

Is there's something I'm missing?

Alberto

---
[ 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                       ]



