From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15176 invoked by alias); 3 Jul 2002 20:26:04 -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 15118 invoked by uid 71); 3 Jul 2002 20:26:02 -0000 Resent-Date: 3 Jul 2002 20:26:02 -0000 Resent-Message-ID: <20020703202602.15117.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, geb@attbi.com Received: (qmail 9430 invoked from network); 3 Jul 2002 20:18:41 -0000 Received: from unknown (HELO sccrmhc02.attbi.com) (204.127.202.62) by sources.redhat.com with SMTP; 3 Jul 2002 20:18:41 -0000 Received: from smbear.attbi.com ([12.235.196.203]) by sccrmhc02.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020703201841.EJKO6023.sccrmhc02.attbi.com@smbear.attbi.com> for ; Wed, 3 Jul 2002 20:18:41 +0000 Received: by smbear.attbi.com (Postfix, from userid 501) id 082FB4F2E; Wed, 3 Jul 2002 13:27:56 -0700 (PDT) Message-Id: <20020703202756.082FB4F2E@smbear.attbi.com> Date: Wed, 03 Jul 2002 13:26:00 -0000 From: geb@attbi.com To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: 3.113 Subject: c++/7202: function arg of "int X(0)" causes seg fault in compiler X-SW-Source: 2002-07/txt/msg00135.txt.bz2 List-Id: >Number: 7202 >Category: c++ >Synopsis: function arg of "int X(0)" causes seg fault in compiler >Confidential: no >Severity: serious >Priority: low >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Wed Jul 03 13:26:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Gary Barnes >Release: 3.0.1 >Organization: none >Environment: System: Linux smbear.attbi.com 2.4.3-20mdk #1 Sun Apr 15 23:03:10 CEST 2001 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ./configure --prefix=/usr/local >Description: Using g++ command, immediate internal error, segmentation fault. Appears to be due to use of constructor for default value of function argument. >How-To-Repeat: This command line: g++ -c foo.cc -o foo.o -g -MMD -frepo -ansi -pedantic -fshort-enums -W -Wall \ -Wundef -Wshadow -Wpointer_arith -Wbad-function-cast -Wcast-qual -Wcast-align \ -Wwrite-strings -Wconversion -Wsign-compare -Wredundant-decls \ -Wunreachable-code -Wmissing-declarations -Winline -fmessage-length=99999 \ -Werror This is the source code in foo.cc: template class One { public: virtual int Func (int X (0)); }; template int One ::Func (int X (0)) { return 1; } >Fix: Use int X = int (0) instead. I discovered this using a more complicated type of course, one that had a nontrivial constructor, but the bug shows with int. >Release-Note: >Audit-Trail: >Unformatted: