diff options
author | Dodji Seketeli <dodji@seketeli.org> | 2013-06-25 16:51:50 +0200 |
---|---|---|
committer | Dodji Seketeli <dodji@seketeli.org> | 2013-06-25 16:51:50 +0200 |
commit | 236c579f9d5394c5213294fae864ab807fd550ab (patch) | |
tree | df18f9d5058aea2c82d8419354ca4f6a341a3066 | |
parent | 9051e7580bda0a8f07b27bbd4093b314ca740ec4 (diff) | |
download | gcc-236c579f9d5394c5213294fae864ab807fd550ab.tar.gz |
Fix handling of declaration-only classes
gcc/cp/
* abi-instr.cc (gen_class_type_in_scope): Handle definition of
class type declaration-only here ...
(gen_type_in_scope): ... not here.
-rw-r--r-- | gcc/cp/abi-instr.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/gcc/cp/abi-instr.cc b/gcc/cp/abi-instr.cc index 8b7cedf13a2..717be2d596a 100644 --- a/gcc/cp/abi-instr.cc +++ b/gcc/cp/abi-instr.cc @@ -832,6 +832,13 @@ gen_class_type_in_scope (const_tree t, result = class_type; get_wip_classes_map ().erase (t); + // Handle definition of earlier declaration-only + { + class_map::const_iterator i = get_tree_2_class_map ().find (t); + if (i != get_tree_2_class_map ().end ()) + result->set_earlier_declaration (i->second); + } + get_tree_2_class_map ()[t] = result; return result; @@ -1066,18 +1073,7 @@ gen_type_in_scope (const_tree t, break; case RECORD_TYPE: - { - shared_ptr <abigail::class_decl> r = - gen_class_type_in_scope (t, scope); - if (r) - { - type_map::const_iterator i = m.find (t); - if (i != m.end ()) - // There was an earlier declaration for this class. - r->set_earlier_declaration (i->second); - result = r; - } - } + result = gen_class_type_in_scope (t, scope); break; default: |