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