From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12772 invoked by alias); 20 Sep 2009 09:59:11 -0000 Received: (qmail 12762 invoked by uid 22791); 20 Sep 2009 09:59:10 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.enyo.de (HELO mail.enyo.de) (212.9.189.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 20 Sep 2009 09:59:05 +0000 Received: from deneb.vpn.enyo.de ([212.9.189.177] helo=deneb.enyo.de) by mail.enyo.de with esmtp id 1MpJC9-0005Yi-Mc for gcc@gcc.gnu.org; Sun, 20 Sep 2009 11:59:01 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.69) (envelope-from ) id 1MpJC9-0005SB-8P for gcc@gcc.gnu.org; Sun, 20 Sep 2009 09:59:01 +0000 From: Florian Weimer To: gcc@gcc.gnu.org Subject: C++: variable length arrays and operator new[] Date: Sun, 20 Sep 2009 09:59:00 -0000 Message-ID: <87r5u2lyxm.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-09/txt/msg00372.txt.bz2 G++ currently accepts the following code: char * alloc(unsigned a, unsigned b) { typedef char array[a]; return &**(new array[b]); } Is this intentional? The equivalent "new char[a][b]" is rejected (as required by the C++ standard).