diff options
author | Mark Mitchell <mark@codesourcery.com> | 2005-01-06 20:21:13 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2005-01-06 20:21:13 +0000 |
commit | 27d6592cc72001b4d4c9b9b4555eecc19d0203e9 (patch) | |
tree | 307172f1e13dfc0be1ce45edfd079614f0da9c2e /gcc/cp/class.c | |
parent | 27916b83f5f371d27f728fcc003fe93b0e44b3cc (diff) | |
download | gcc-27d6592cc72001b4d4c9b9b4555eecc19d0203e9.zip gcc-27d6592cc72001b4d4c9b9b4555eecc19d0203e9.tar.gz gcc-27d6592cc72001b4d4c9b9b4555eecc19d0203e9.tar.bz2 |
re PR c++/19244 (Typedef of anonymous class incorrectly handled in member function definition)
PR c++/19244
* class.c (add_implicitly_declared_members): Remove dead code.
* decl.c (grokfndecl): Add sfk parameter. Use it do set
DECL_CONSTRUCTOR_P.
(grokdeclarator): Adjust calls to grokfndecl.
* method.c (implicitly_declare_fn): Improve documentation.
* parser.c (cp_parser_direct_declarator): Do not consider a
function to be a constructor if the containing class was
originally anonymous.
PR c++/19244
* g++.dg/parser/ctor2.C: New test.
From-SVN: r93004
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r-- | gcc/cp/class.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c index 597ec92..00e6a7e 100644 --- a/gcc/cp/class.c +++ b/gcc/cp/class.c @@ -2485,17 +2485,11 @@ add_implicitly_declared_members (tree t, default_fn = implicitly_declare_fn (sfk_destructor, t, /*const_p=*/0); check_for_override (default_fn, t); - /* If we couldn't make it work, then pretend we didn't need it. */ - if (default_fn == void_type_node) - TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) = 0; - else - { - TREE_CHAIN (default_fn) = implicit_fns; - implicit_fns = default_fn; - - if (DECL_VINDEX (default_fn)) - virtual_dtor = default_fn; - } + TREE_CHAIN (default_fn) = implicit_fns; + implicit_fns = default_fn; + + if (DECL_VINDEX (default_fn)) + virtual_dtor = default_fn; } else /* Any non-implicit destructor is non-trivial. */ |