From: Jason Merrill Date: Thu, 12 Feb 2009 02:01:07 +0000 (-0500) Subject: re PR c++/39153 (virtual default dtor not defined) X-Git-Tag: releases/gcc-4.4.0~575 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bff54b198738a1abe0aa043beda37794c040e604;p=thirdparty%2Fgcc.git re PR c++/39153 (virtual default dtor not defined) PR c++/39153 * decl2.c (cp_write_global_declarations): Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL. From-SVN: r144119 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 58bffd77e253..7a764b1a22e4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2009-02-11 Jason Merrill + PR c++/39153 + * decl2.c (cp_write_global_declarations): + Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL. + PR c++/30111 * init.c (build_value_init_noctor): Split out from... (build_value_init): ...here. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index c8887257ece1..2cafc8377656 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -3487,7 +3487,7 @@ cp_write_global_declarations (void) for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i) { /* Does it need synthesizing? */ - if (DECL_ARTIFICIAL (decl) && ! DECL_INITIAL (decl) + if (DECL_DEFAULTED_FN (decl) && ! DECL_INITIAL (decl) && (! DECL_REALLY_EXTERN (decl) || possibly_inlined_p (decl))) { /* Even though we're already at the top-level, we push diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7c088650e974..b140c2f1e6de 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2009-02-11 Jason Merrill + PR c++/39153 + * g++.dg/cpp0x/defaulted9.C: New test. + PR c++/30111 * g++.dg/init/value7.C: New test. diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted9.C b/gcc/testsuite/g++.dg/cpp0x/defaulted9.C new file mode 100644 index 000000000000..c067065f13e9 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/defaulted9.C @@ -0,0 +1,17 @@ +// PR c++/39153 + +struct _Impl_base +{ + _Impl_base() = default; + virtual ~_Impl_base() = default; +}; + +template +class _Impl : public _Impl_base +{ }; + +int main() +{ + _Impl i; + return 0; +}