http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53470
Jason Merrill <jason at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jason at gcc dot gnu.org --- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> 2012-06-05 18:07:14 UTC --- OK, here's the problem: free_lang_data_in_type clears TYPE_CONTEXT of Holder. gen_tagged_type_die tries to emit an enclosing class first, but since TYPE_CONTEXT is null, it thinks Holder isn't a nested class. gen_struct_or_union_type_die calls scope_die_for, which forces out ExtensionCord, which also generates a DIE for Holder. gen_struct_or_union_type_die contiues to generate what is now a duplicate DIE for Holder. What is the rationale for clearing TYPE_CONTEXT of Holder? It seems quite deliberate, but there's no comment explaining why it would be a good idea.