From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10963 invoked by alias); 11 Feb 2003 10:26:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 10894 invoked by uid 71); 11 Feb 2003 10:26:00 -0000 Resent-Date: 11 Feb 2003 10:26:00 -0000 Resent-Message-ID: <20030211102600.10893.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, papadopo@sources.redhat.com, at@sources.redhat.com, shfj@sources.redhat.com, cea@sources.redhat.com, fr@sources.redhat.com Received: (qmail 10124 invoked by uid 48); 11 Feb 2003 10:21:09 -0000 Message-Id: <20030211102109.10123.qmail@sources.redhat.com> Date: Tue, 11 Feb 2003 10:26:00 -0000 From: papadopo@sources.redhat.com, at@sources.redhat.com, shfj@sources.redhat.com, cea@sources.redhat.com, fr@sources.redhat.com Reply-To: papadopo@sources.redhat.com, at@sources.redhat.com, shfj@sources.redhat.com, cea@sources.redhat.com, fr@sources.redhat.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9658: compiler accepts invalid code X-SW-Source: 2003-02/txt/msg00486.txt.bz2 List-Id: >Number: 9658 >Category: c++ >Synopsis: compiler accepts invalid code >Confidential: no >Severity: non-critical >Priority: medium >Responsible: unassigned >State: open >Class: accepts-illegal >Submitter-Id: net >Arrival-Date: Tue Feb 11 10:26:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Dimitri Papadopoulos >Release: gcc-3.2.2 >Organization: >Environment: Solaris 8 (7/01) >Description: Sun and SGI compilers emit an error on the attached code: $ CC -V CC: Sun WorkShop 6 update 2 C++ 5.3 Patch 111685-12 2002/12/16 $ CC -c foo.cc "foo.cc", line 2: Error: Cannot use int* to initialize int**. 1 Error(s) detected. $ $ CC -version MIPSpro Compilers: Version 7.3.1.3m $ CC -c foo.cc cc-1140 CC: ERROR File = foo.cc, Line = 2 A value of type "int *" cannot be used to initialize an entity of type "int **" . int **foo = new (int*)[33]; ^ ... $ The GNU compiler doesn't. The Sun engineers insist this is not legal code. >How-To-Repeat: $ g++ -Wall -c foo.c $ >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: application/octet-stream; name="foo.cc" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="foo.cc" aW50IG1haW4oKSB7CiAgIGludCAqKmZvbyA9IG5ldyAoaW50KilbMzNdOwp9Cg==