public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35734]  New: [4.3/4.4 regression] ICE with copy constructor in derived class
@ 2008-03-28 17:33 reichelt at gcc dot gnu dot org
  2008-03-28 17:33 ` [Bug c++/35734] " reichelt at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-28 17:33 UTC (permalink / raw)
  To: gcc-bugs

The following valid code snippet triggers an ICE since GCC 4.3.0
when compiled with "-W":

=========================================
struct A
{
  A();
  template<typename T> A(const T&);
};

struct B : A
{
  B(const B&) {}
};
=========================================

bug.cc: In copy constructor 'B::B(const B&)':
bug.cc:9: internal compiler error: tree check: expected function_decl, have
template_decl in type_has_user_nondefault_constructor, at cp/class.c:4063
Please submit a full bug report, [etc.]

In earlier versions we issued the warning:
bug.cc: In copy constructor 'B::B(const B&)':
bug.cc:9: warning: base class 'struct A' should be explicitly initialized in
the copy constructor


-- 
           Summary: [4.3/4.4 regression] ICE with copy constructor in
                    derived class
           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=35734


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

* [Bug c++/35734] [4.3/4.4 regression] ICE with copy constructor in derived class
  2008-03-28 17:33 [Bug c++/35734] New: [4.3/4.4 regression] ICE with copy constructor in derived class reichelt at gcc dot gnu dot org
@ 2008-03-28 17:33 ` reichelt at gcc dot gnu dot org
  2008-03-28 17:37 ` reichelt at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-28 17:33 UTC (permalink / raw)
  To: gcc-bugs



-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.1


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


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

* [Bug c++/35734] [4.3/4.4 regression] ICE with copy constructor in derived class
  2008-03-28 17:33 [Bug c++/35734] New: [4.3/4.4 regression] ICE with copy constructor in derived class reichelt at gcc dot gnu dot org
  2008-03-28 17:33 ` [Bug c++/35734] " reichelt at gcc dot gnu dot org
@ 2008-03-28 17:37 ` reichelt at gcc dot gnu dot org
  2008-03-28 18:33 ` jason at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-03-28 17:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from reichelt at gcc dot gnu dot org  2008-03-28 17:37 -------
Manuel, Jason, was probably introduced by your patch:

2008-02-14  Manuel Lopez-Ibanez  <manu@gcc.gnu.org>
            Jason Merrill  <jason@redhat.com>

        PR c++/5645
        PR c++/11159
        * class.c (type_has_user_nondefault_constructor): New fn.
        * cp-tree.h: Declare it.
        * init.c (emit_mem_initializers): Use it for -W warning about
        missing base initializer.


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com,
                   |                            |manu at gcc dot gnu dot org


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


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

* [Bug c++/35734] [4.3/4.4 regression] ICE with copy constructor in derived class
  2008-03-28 17:33 [Bug c++/35734] New: [4.3/4.4 regression] ICE with copy constructor in derived class reichelt at gcc dot gnu dot org
  2008-03-28 17:33 ` [Bug c++/35734] " reichelt at gcc dot gnu dot org
  2008-03-28 17:37 ` reichelt at gcc dot gnu dot org
@ 2008-03-28 18:33 ` jason at gcc dot gnu dot org
  2008-04-07 20:51 ` jason at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-03-28 18:33 UTC (permalink / raw)
  To: gcc-bugs



-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jason at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-03-28 18:33:16
               date|                            |


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


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

* [Bug c++/35734] [4.3/4.4 regression] ICE with copy constructor in derived class
  2008-03-28 17:33 [Bug c++/35734] New: [4.3/4.4 regression] ICE with copy constructor in derived class reichelt at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-03-28 18:33 ` jason at gcc dot gnu dot org
@ 2008-04-07 20:51 ` jason at gcc dot gnu dot org
  2008-04-08 17:51 ` jason at gcc dot gnu dot org
  2008-04-09 14:26 ` jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-04-07 20:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jason at gcc dot gnu dot org  2008-04-07 20:51 -------
Subject: Bug 35734

Author: jason
Date: Mon Apr  7 20:50:21 2008
New Revision: 133987

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133987
Log:
        PR c++/35734
        * class.c (type_has_user_nondefault_constructor): A template
        counts as a nondefault constructor.

Added:
    trunk/gcc/testsuite/g++.dg/warn/ctor1.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/class.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/35734] [4.3/4.4 regression] ICE with copy constructor in derived class
  2008-03-28 17:33 [Bug c++/35734] New: [4.3/4.4 regression] ICE with copy constructor in derived class reichelt at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2008-04-07 20:51 ` jason at gcc dot gnu dot org
@ 2008-04-08 17:51 ` jason at gcc dot gnu dot org
  2008-04-09 14:26 ` jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jason at gcc dot gnu dot org @ 2008-04-08 17:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jason at gcc dot gnu dot org  2008-04-08 17:50 -------
Subject: Bug 35734

Author: jason
Date: Tue Apr  8 17:49:56 2008
New Revision: 134099

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134099
Log:
        PR c++/35734
        * class.c (type_has_user_nondefault_constructor): A template
        counts as a nondefault constructor.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/g++.dg/warn/ctor1.C
      - copied unchanged from r133987, trunk/gcc/testsuite/g++.dg/warn/ctor1.C
Modified:
    branches/gcc-4_3-branch/gcc/cp/ChangeLog
    branches/gcc-4_3-branch/gcc/cp/class.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/35734] [4.3/4.4 regression] ICE with copy constructor in derived class
  2008-03-28 17:33 [Bug c++/35734] New: [4.3/4.4 regression] ICE with copy constructor in derived class reichelt at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2008-04-08 17:51 ` jason at gcc dot gnu dot org
@ 2008-04-09 14:26 ` jakub at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-04-09 14:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2008-04-09 14:25 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2008-04-09 14:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-28 17:33 [Bug c++/35734] New: [4.3/4.4 regression] ICE with copy constructor in derived class reichelt at gcc dot gnu dot org
2008-03-28 17:33 ` [Bug c++/35734] " reichelt at gcc dot gnu dot org
2008-03-28 17:37 ` reichelt at gcc dot gnu dot org
2008-03-28 18:33 ` jason at gcc dot gnu dot org
2008-04-07 20:51 ` jason at gcc dot gnu dot org
2008-04-08 17:51 ` jason at gcc dot gnu dot org
2008-04-09 14:26 ` jakub 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).