From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30166 invoked by alias); 7 Mar 2003 14:55:56 -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 30147 invoked by uid 48); 7 Mar 2003 14:55:56 -0000 Date: Fri, 07 Mar 2003 14:55:00 -0000 Message-ID: <20030307145556.30146.qmail@sources.redhat.com> To: a.shipman@bom.gov.au, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org From: bangerth@dealii.org Reply-To: bangerth@dealii.org, a.shipman@bom.gov.au, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: c++/9987: Failure to call a copy constructor with complex templated member functions. X-SW-Source: 2003-03/txt/msg00351.txt.bz2 List-Id: Synopsis: Failure to call a copy constructor with complex templated member functions. State-Changed-From-To: open->closed State-Changed-By: bangerth State-Changed-When: Fri Mar 7 14:55:56 2003 State-Changed-Why: Not a bug. If you have template class X { template X (const X &); } X x_int1; X x_int2(x_int1); X x_char(x_int1); then the templated copy constructor is called in the initialization of x_char, but _not_ in that of x_int2. For the latter, the compiler synthesizes the byte-copy default copy constructor. If you want to have a user defined copy constructor for the case T==U, then you have to declare and implement it. Doing so in your program makes the SegFault go away (just checked that). Regards Wolfgang http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9987