Commit bff54b19 by Jason Merrill Committed by Jason Merrill

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
parent c8619fe9
2009-02-11 Jason Merrill <jason@redhat.com> 2009-02-11 Jason Merrill <jason@redhat.com>
PR c++/39153
* decl2.c (cp_write_global_declarations):
Check DECL_DEFAULTED_FN, not DECL_ARTIFICIAL.
PR c++/30111 PR c++/30111
* init.c (build_value_init_noctor): Split out from... * init.c (build_value_init_noctor): Split out from...
(build_value_init): ...here. (build_value_init): ...here.
......
...@@ -3487,7 +3487,7 @@ cp_write_global_declarations (void) ...@@ -3487,7 +3487,7 @@ cp_write_global_declarations (void)
for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i) for (i = 0; VEC_iterate (tree, deferred_fns, i, decl); ++i)
{ {
/* Does it need synthesizing? */ /* 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))) && (! DECL_REALLY_EXTERN (decl) || possibly_inlined_p (decl)))
{ {
/* Even though we're already at the top-level, we push /* Even though we're already at the top-level, we push
......
2009-02-11 Jason Merrill <jason@redhat.com> 2009-02-11 Jason Merrill <jason@redhat.com>
PR c++/39153
* g++.dg/cpp0x/defaulted9.C: New test.
PR c++/30111 PR c++/30111
* g++.dg/init/value7.C: New test. * g++.dg/init/value7.C: New test.
......
// PR c++/39153
struct _Impl_base
{
_Impl_base() = default;
virtual ~_Impl_base() = default;
};
template<typename _Tp>
class _Impl : public _Impl_base
{ };
int main()
{
_Impl<int> i;
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment