From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19279 invoked by alias); 16 Jan 2003 09:36:03 -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 19250 invoked by uid 71); 16 Jan 2003 09:36:01 -0000 Resent-Date: 16 Jan 2003 09:36:01 -0000 Resent-Message-ID: <20030116093601.19248.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, martin@xemacs.org Received: (qmail 17405 invoked by uid 61); 16 Jan 2003 09:29:31 -0000 Message-Id: <20030116092931.17404.qmail@sources.redhat.com> Date: Thu, 16 Jan 2003 09:36:00 -0000 From: martin@xemacs.org Reply-To: martin@xemacs.org To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version: gnatsweb-2.9.3 (1.1.1.1.2.31) Subject: c++/9338: ICE in peculiar templated constructors X-SW-Source: 2003-01/txt/msg00995.txt.bz2 List-Id: >Number: 9338 >Category: c++ >Synopsis: ICE in peculiar templated constructors >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: ice-on-legal-code >Submitter-Id: net >Arrival-Date: Thu Jan 16 01:36:01 PST 2003 >Closed-Date: >Last-Modified: >Originator: Martin Buchholz >Release: gcc-3.2.1 >Organization: >Environment: Linux x86 >Description: The file below results in ICE g++ main.cc -o main main.cc: In function `int main(int, char**)': main.cc:36: internal error: Segmentation fault Please submit a full bug report, The file compiles (with warnings) under icc, but fails to link. ------------------------------------------------------ class Bool { public: const bool val_; template struct Constraint; template struct Constraint { typedef int Dummy; }; template struct Convertible { enum { value = true }; }; template explicit Bool (T x, typename Constraint::value>::Dummy = 0) : val_ (bool (x)) {} template struct Unlikely { enum { value = false }; }; template explicit Bool (T x, typename Constraint::value>::Dummy = 0); template Bool (T x, typename Constraint::value>::Dummy = 0); Bool (bool val) : val_ (val) {} Bool (const Bool & val) : val_ (bool (val)) {} struct S_ { int M_; }; operator int S_::* () const { return val_ ? & S_::M_ : 0; } }; struct X { bool b; X (bool x) : b (x) {} struct S_ { int M_; }; operator int S_::* () const { return b ? & S_::M_ : 0; } }; int main (int argc, char *argv[]) { Bool b (X (true)); } >How-To-Repeat: g++ main.cc -o main >Fix: >Release-Note: >Audit-Trail: >Unformatted: