public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31131]  New: [4.2/4.3 regression] ICE on invalid constructor definition
@ 2007-03-11 11:50 reichelt at gcc dot gnu dot org
  2007-03-11 11:51 ` [Bug c++/31131] " reichelt at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2007-03-11 11:50 UTC (permalink / raw)
  To: gcc-bugs

The following invalid code snippet triggers an ICE on mainline and 4.2 branch:

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

template<int N> A<N>::A() {}

struct B
{
  A<0> a;
};

B b;
=====================================

bug.cc:6: error: prototype for 'A<N>::A()' does not match any in class 'A<N>'
bug.cc:3: error: candidate is: A<N>::A(int)
bug.cc:6: error: template definition of non-template 'A<N>::A()'
bug.cc:13: internal compiler error: in locate_ctor, at cp/method.c:899
Please submit a full bug report, [etc.]

If I replace "A(int);" by "A(0);" I get a slightly different crash:

bug.cc:3: error: expected unqualified-id before numeric constant
bug.cc:3: error: expected `)' before numeric constant
bug.cc:6: error: no 'A<N>::A()' member function declared in class 'A<N>'
bug.cc:6: error: template definition of non-template 'A<N>::A()'
bug.cc:13: internal compiler error: vector VEC(tree,base) index domain error,
in locate_ctor at cp/method.c:889
Please submit a full bug report, [etc.]


-- 
           Summary: [4.2/4.3 regression] ICE on invalid constructor
                    definition
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code, error-recovery, 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=31131


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

end of thread, other threads:[~2009-03-30 21:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-11 11:50 [Bug c++/31131] New: [4.2/4.3 regression] ICE on invalid constructor definition reichelt at gcc dot gnu dot org
2007-03-11 11:51 ` [Bug c++/31131] " reichelt at gcc dot gnu dot org
2007-03-11 19:55 ` mmitchel at gcc dot gnu dot org
2007-04-29  6:52 ` pinskia at gcc dot gnu dot org
2007-05-14 21:30 ` mmitchel at gcc dot gnu dot org
2007-07-20  3:50 ` mmitchel at gcc dot gnu dot org
2007-08-21 20:07 ` [Bug c++/31131] [4.2 " reichelt at gcc dot gnu dot org
2007-10-09 19:29 ` mmitchel at gcc dot gnu dot org
2008-02-01 16:57 ` jsm28 at gcc dot gnu dot org
2008-03-16 17:18 ` rguenth at gcc dot gnu dot org
2008-05-19 20:26 ` jsm28 at gcc dot gnu dot org
2009-03-30 21:41 ` jsm28 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).