mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-16 02:20:27 +08:00
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:
parent
d8ec5bf231
commit
c2b58ba219
@ -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.
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
13
gcc/testsuite/g++.dg/warn/ctor1.C
Normal file
13
gcc/testsuite/g++.dg/warn/ctor1.C
Normal 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" }
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user