From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24439 invoked by alias); 7 Dec 2002 16:16: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 24402 invoked by uid 71); 7 Dec 2002 16:16:00 -0000 Resent-Date: 7 Dec 2002 16:16:00 -0000 Resent-Message-ID: <20021207161600.24401.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, a-hw@mail.ru Received: (qmail 23792 invoked by uid 61); 7 Dec 2002 16:09:30 -0000 Message-Id: <20021207160930.23791.qmail@sources.redhat.com> Date: Sat, 07 Dec 2002 08:16:00 -0000 From: a-hw@mail.ru Reply-To: a-hw@mail.ru To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/8860: illegal constructor causes internal compiler error X-SW-Source: 2002-12/txt/msg00438.txt.bz2 List-Id: >Number: 8860 >Category: c++ >Synopsis: illegal constructor causes internal compiler error >Confidential: no >Severity: serious >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Sat Dec 07 08:16:00 PST 2002 >Closed-Date: >Last-Modified: >Originator: a-hw@mail.ru >Release: gcc (GCC) 3.2 (mingw special 20020817-1) >Organization: >Environment: Win2K, MingGW 2.0.0 prebuilt binaries >Description: This code causes g++ to feel segmentation fault. I've replaced initializer for base class Smoother(size) with Smoother_Lookup(size): template class Smoother_Lookup : public Smoother { public: Smoother_Lookup(int size) : Smoother_Lookup(size), lookup(size) { std::generate_n(lookup.begin(), size, Function(size)); } int smooth(int r) { return lookup[r]; } protected: std::vector lookup; }; >How-To-Repeat: Try to compile test.cpp: make test.o >Fix: >Release-Note: >Audit-Trail: >Unformatted: ----gnatsweb-attachment---- Content-Type: text/plain; name="test.cpp" Content-Disposition: inline; filename="test.cpp" #include class Smoother { public: Smoother(int size) : _size(size) { } virtual ~Smoother() = 0; virtual int smooth(int r) = 0; protected: int _size; }; template class Smoother_Lookup : public Smoother { public: Smoother_Lookup(int size) : Smoother_Lookup(size), lookup(size) { std::generate_n(lookup.begin(), size, Function(size)); } int smooth(int r) { return lookup[r]; } protected: std::vector lookup; }; struct Test { int operator()() { return 0; } }; int f() { Smoother_Lookup sl(1); }