public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39055]  New: [4.2/4.3/4.4 regression] ICE with questionable default parameter of a member function
@ 2009-02-01 10:16 reichelt at gcc dot gnu dot org
  2009-02-01 10:16 ` [Bug c++/39055] " reichelt at gcc dot gnu dot org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2009-02-01 10:16 UTC (permalink / raw)
  To: gcc-bugs

The following valid code snippet triggers an ICE since GCC 3.4.0:

==============================
template<int> struct A
{
  int i;
  A() { void foo(int=i); }
};

A<0> a;
==============================

bug.cc: In function 'void foo(int) [with int <anonymous> = 0]':
bug.cc:4:   instantiated from 'A<<anonymous> >::A() [with int <anonymous> = 0]'
bug.cc:7:   instantiated from here
bug.cc:4: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]

GCC 3.3.x wrongly rejected the code ('i' as default parameter is not OK,
but this should only be diagnosed if the default parameter is actually used).

GCC 3.[012].x correctly accepted the code.

Btw, the code compiles fine if A is not a template class.


-- 
           Summary: [4.2/4.3/4.4 regression] ICE with questionable default
                    parameter of a member function
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, monitored
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2010-06-07 15:52 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-01 10:16 [Bug c++/39055] New: [4.2/4.3/4.4 regression] ICE with questionable default parameter of a member function reichelt at gcc dot gnu dot org
2009-02-01 10:16 ` [Bug c++/39055] " reichelt at gcc dot gnu dot org
2009-02-01 10:58 ` rguenth at gcc dot gnu dot org
2009-02-06  2:25 ` pinskia at gcc dot gnu dot org
2009-02-12 23:23 ` bangerth at gmail dot com
2009-02-20  5:38 ` jason at gcc dot gnu dot org
2009-03-22 14:02 ` jason at gcc dot gnu dot org
2009-03-31 21:09 ` [Bug c++/39055] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-07-18 11:26 ` reichelt at gcc dot gnu dot org
2009-07-18 11:38 ` jason at gcc dot gnu dot org
2009-08-04 12:47 ` rguenth at gcc dot gnu dot org
2009-11-12 22:48 ` jason at gcc dot gnu dot org
2009-11-13 16:16 ` jason at gcc dot gnu dot org
2010-05-22 18:29 ` [Bug c++/39055] [4.3/4.4/4.5/4.6 " rguenth at gcc dot gnu dot org
2010-06-07 15:52 ` jason at gcc dot gnu dot org

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).