------- Comment #8 from dodji at gcc dot gnu dot org 2009-03-17 10:02 ------- Subject: Re: DW_TAG_imported_module should be used (not DW_TAG_imported_declaration) jakub at gcc dot gnu dot org a écrit : > ------- Comment #7 from jakub at gcc dot gnu dot org 2009-03-17 08:52 ------- > Created an attachment (id=17472) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17472&action=view) > --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17472&action=view) > gcc44-local-imported-decl.patch > > Incremental patch to emit DW_TAG_imported_declaration DIEs (other than > namespace aliases) in the right lexical blocks. > I am wondering what happens when cp_emit_debug_info_for_using is called for a using declaration that appears at global scope. Once we are in the USING_STMT case of cp_gimplify_expr, will there be an enclosing GIMPLE_BIND for the USING_STMT generated for the global using declaration ? For the record, cp_parser_using_declaration calls either do_local_using_decl or do_toplevel_using_decl, depending on if we are at local or global scope. Both do_local_using_decl and do_toplevel_using_decl end up calling cp_parser_using_declaration. > > Concerning: > "We won't be going through the USING_STMT code path in case of We won't be > going through the USING_STMT code path in case of namespace aliases, sorry. My > last comment was irrelevant." > we really should be going through USING_STMT or something similar for namespace > aliases as well, see PR37890. Given that namespace aliases are just emitted > using gen_namespace_die, perhaps just adding the NAMESPACE_DECL to BLOCK_VARS Yeah I should try something like that in cp_gimplify_expr whenever we are handed BIND_EXPR. In that case, I can wall the BIND_EXPR_VARS of the of the BIND_EXPR and add any NAMESPACE_DECL to the BLOCK_VARS of the matching block. Would that make sense ? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39471