re PR c++/35734 (ICE with copy constructor in derived class)

PR c++/35734
        * class.c (type_has_user_nondefault_constructor): A template
        counts as a nondefault constructor.

From-SVN: r133987
This commit is contained in:
Jason Merrill 2008-04-07 16:50:21 -04:00 committed by Jason Merrill
parent d8ec5bf231
commit c2b58ba219
4 changed files with 27 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2008-04-07 Jason Merrill <jason@redhat.com>
PR c++/35734
* class.c (type_has_user_nondefault_constructor): A template
counts as a nondefault constructor.
2008-04-04 Paolo Bonzini <bonzini@gnu.org>
* decl.c (cxx_push_function_context): Delete.

View File

@ -4060,7 +4060,9 @@ type_has_user_nondefault_constructor (tree t)
{
tree fn = OVL_CURRENT (fns);
if (!DECL_ARTIFICIAL (fn)
&& skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn)) != NULL_TREE)
&& (TREE_CODE (fn) == TEMPLATE_DECL
|| (skip_artificial_parms_for (fn, DECL_ARGUMENTS (fn))
!= NULL_TREE)))
return true;
}

View File

@ -1,3 +1,8 @@
2008-04-07 Jason Merrill <jason@redhat.com>
PR c++/35734
* g++.dg/warn/ctor1.C: New.
2008-04-07 Kai Tietz <kai.tietz@onevision.com>
PR/35842

View File

@ -0,0 +1,13 @@
// PR c++/35734
// { dg-options "-W" }
struct A
{
A();
template<typename T> A(const T&);
};
struct B : A
{
B(const B&) {} // { dg-warning "base class" }
};