From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6271 invoked by alias); 20 May 2002 05:16: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 6220 invoked by uid 71); 20 May 2002 05:16:00 -0000 Resent-Date: 20 May 2002 05:16:00 -0000 Resent-Message-ID: <20020520051600.6219.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, bbaetz@student.usyd.edu.au Received:(qmail 2482 invoked from network); 20 May 2002 05:10:58 -0000 Received: from unknown (HELO tomato.home) (211.28.73.56) by sources.redhat.com with SMTP; 20 May 2002 05:10:58 -0000 Received: (from bbaetz@localhost) by tomato.home (8.11.6/8.11.6) id g4K5AvU02682; Mon, 20 May 2002 15:10:57 +1000 Message-Id:<200205200510.g4K5AvU02682@tomato.home> Date: Sun, 19 May 2002 22:16:00 -0000 From: bbaetz@student.usyd.edu.au To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:3.113 Subject: c++/6730: Crash involving templates when compiling program X-SW-Source: 2002-05/txt/msg00583.txt.bz2 List-Id: >Number: 6730 >Category: c++ >Synopsis: Crash involving templates when compiling program >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Sun May 19 22:16:00 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Bradley Baetz >Release: 3.2 20020519 (experimental) >Organization: >Environment: System: Linux tomato.home 2.4.18 #8 Thu Feb 28 22:43:37 EST 2002 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: ../gcc/configure --prefix=/home/bbaetz/gcc/ --enable-languages=c,c++,treelang --enable-threads=posix --disable-checking >Description: I was attempting to get the testcase in http://groups.google.com/groups?selm=1018969434.13641.0.nnrp-07.3e31d362%40news.demon.co.uk to work. Uncommenting either of the usages of has_subscript_operator in main causes a crash: sub.cpp: In instantiation of `has_subscript_operator': sub.cpp:13: instantiated from here sub.cpp:6: internal error: Segmentation fault The first line is obviously illegal (a typo I made while I was playing with the testcase), but I believe that the second should be OK. >How-To-Repeat: template class has_subscript_operator { private: template struct helper {}; template static int foo( helper * ); public: int value() { return 0; }; }; int main() { // return has_subscript_operator::value; return has_subscript_operator().value(); } g++ -Wall sub.cc >Fix: Removing the unused template functions (which are unused in this example) from the class avoids the crash. >Release-Note: >Audit-Trail: >Unformatted: