From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12766 invoked by alias); 20 Feb 2003 23:18:15 -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 12747 invoked by uid 48); 20 Feb 2003 23:18:14 -0000 Date: Thu, 20 Feb 2003 23:18:00 -0000 Message-ID: <20030220231814.12746.qmail@sources.redhat.com> To: Michael.J.Kenny@saic.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, Michael.J.Kenny@saic.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/9782: constructor not called on higher-dimensional arrays of template types X-SW-Source: 2003-02/txt/msg01043.txt.bz2 List-Id: Old Synopsis: constructor not called on typedef'd templated object New Synopsis: constructor not called on higher-dimensional arrays of template types State-Changed-From-To: open->analyzed State-Changed-By: bangerth State-Changed-When: Thu Feb 20 23:18:14 2003 State-Changed-Why: Confirmed with 2.95...present mainline. Problem is more convenient to see here: ---------------------------------- extern "C" void printf(char *, ...); template struct A { A() {printf("A::A()\n");} }; struct B { B() {printf("B::B()\n");} }; int main () { new A<0>[1][1]; // constructor apparently _not_ called new B [1][1]; // constructor _is_ called } ------------------------------- A and B differ only in that one is a template and the other is not. Yet, only the constructor of B is called: x/bug> /home/bangerth/bin/gcc-3.4-pre/bin/c++ test.C x/bug> ./a.out B::B() If we have a 1d array, both constructors run, as expected. W. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9782