From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13938 invoked by alias); 13 Nov 2007 13:38:54 -0000 Received: (qmail 13891 invoked by uid 48); 13 Nov 2007 13:38:44 -0000 Date: Tue, 13 Nov 2007 13:38:00 -0000 Message-ID: <20071113133844.13890.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c++/32402] Error while allocating array of pointers to objects of a pure virtual class In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "p dot vestjens at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg01173.txt.bz2 ------- Comment #5 from p dot vestjens at gmail dot com 2007-11-13 13:38 ------- Okay. First of all the code causing the problems isn't actually my own code. It is used in the Connexis middleware layer of IBM's Rational Rose Real-Time application. The reproduce.cpp file was created by IBM's support department to reproduce the problem. They claim that the file compiles with the GNU 3.2 compiler but not with the GNU 3.4.4 and 4.1.0 compilers. I'm using GNU 4.1.1 which also doesn't compile the code, but WindRiver's Tornado 2 GNU 2.7.2 and the MS Visual Studio 6 compiler do. The problem seems to lie in the abundant use of parentheses: - "list = new (pure(*[3]));" => does not compile - "list = new (pure*[3]);" => compiles - "list = new pure(*[3]);" => does not compile - "list = new pure*[3];" => compiles So, the only question still relevant to me is whether the original construction is valid C++ code according to the ISO C++ standard. I tried verifying this using the grammar printed in Stroustrup's "C++ Programming language (third edition" but did not quite succeed. I guess grammatically it is ok, but semantically the GCC compiler interprets the construction differently from its previous version(s). How do we determine if the original construction is correct, both grammatically and semantically? If it isn't valid, IBM should fix their code. If it is, there might be a bug in GCC. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32402