public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: bangerth@dealii.org
To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, martin@xemacs.org,
	nobody@gcc.gnu.org
Subject: Re: c++/9338: ICE in peculiar templated constructors
Date: Thu, 16 Jan 2003 15:12:00 -0000	[thread overview]
Message-ID: <20030116151209.20409.qmail@sources.redhat.com> (raw)

Synopsis: ICE in peculiar templated constructors

State-Changed-From-To: open->analyzed
State-Changed-By: bangerth
State-Changed-When: Thu Jan 16 07:12:02 2003
State-Changed-Why:
    Confirmed. A smaller testcase is this:
    -------------------------
    struct Bool {
        template <bool> struct CC { typedef int Int; };
    
        template <typename> struct S1 { enum { value = true }; };
        template <typename> struct S2 { enum { value = false }; };
    
        template <typename T>
        Bool (T x, typename CC<S1<T>::value>::Int = 0);
    
        template <typename T>
        Bool (T x, typename CC<!S2<T>::value>::Int = 0);
    };
    
    int main () {
      Bool b (1);
    }
    --------------------------------------
    Note that the second type of the two overloads of the
    constructor resolve to the same type, int.
    
    This code crashes gcc since at least 2.95:
    g/a> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
    x.cc: In function `int main()':
    x.cc:15: internal compiler error: Segmentation fault
    Please submit a full bug report,
    with preprocessed source if appropriate.
    See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
    
    W.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9338


             reply	other threads:[~2003-01-16 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-16 15:12 bangerth [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-04-07 10:56 Giovanni Bajo
2003-01-16  9:36 martin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030116151209.20409.qmail@sources.redhat.com \
    --to=bangerth@dealii.org \
    --cc=gcc-bugs@gcc.gnu.org \
    --cc=gcc-gnats@gcc.gnu.org \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=martin@xemacs.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).