public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc at abeckmann dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/39822]  New: ICE: Segmentation fault -- with function template default template arguments in c++0x mode
Date: Mon, 20 Apr 2009 17:28:00 -0000	[thread overview]
Message-ID: <bug-39822-14599@http.gcc.gnu.org/bugzilla/> (raw)

The following testcase produces a segmentation fault in --std=c++0x mode (in
4.3, 4.4, 4.5):

----- 8< -----
template < typename >
struct A ;
template < typename X, template < typename > class = A >
void test ( X )
{
        A < int > T ;
        test ( T ) ;
}
----- >8 -----

===== 4.3.4 -std=c++0x =====
$ x86_64-linux-gnu-g++-4.3.x -v -std=c++0x -c segfault.min.ii

Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4_3-branch/configure
--prefix=/opt/software/gcc-x86_64/gcc-4.3.x --program-suffix=-4.3.x
--enable-languages=c,c++ --enable-checking
Thread model: posix
gcc version 4.3.4 20090413 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-v' '-std=c++0x' '-c' '-shared-libgcc' '-mtune=generic'

/opt/software/gcc-x86_64/gcc-4.3.x/libexec/gcc/x86_64-unknown-linux-gnu/4.3.4/cc1plus
-fpreprocessed segfault.min.ii -quiet -dumpbase segfault.min.ii -mtune=generic
-auxbase segfault.min -std=c++0x -version -o /tmp/cccslkh4.s
GNU C++ (GCC) version 4.3.4 20090413 (prerelease) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.3.4 20090413 (prerelease), GMP version
4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 922fef518d0100daafe6c2059a02f6bf
segfault.min.ii: In function 'void test(X)':
segfault.min.ii:2: internal compiler error: Segmentation fault
===== =====

===== 4.3.4 =====
$ x86_64-linux-gnu-g++-4.3.x -c segfault.min.ii

segfault.min.ii:4: error: default template arguments may not be used in
function templates
segfault.min.ii: In function 'void test(X)':
segfault.min.ii:7: error: no matching function for call to 'test(A<int>&)'
==========


-- 
           Summary: ICE: Segmentation fault -- with function template
                    default template arguments in c++0x mode
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc at abeckmann dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39822


             reply	other threads:[~2009-04-20 17:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-20 17:28 gcc at abeckmann dot de [this message]
2009-04-20 17:41 ` [Bug c++/39822] " paolo dot carlini at oracle dot com
2009-04-20 17:51 ` gcc at abeckmann dot de
2009-04-22 23:55 ` pinskia at gcc dot gnu dot org

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=bug-39822-14599@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).