This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix __PRETTY_FUNCTION__ (PR c++/6794)
On Sun, May 26, 2002 at 03:05:27PM -0400, Jason Merrill wrote:
> >>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
>
> > On Sun, May 26, 2002 at 01:54:58PM -0400, Jason Merrill wrote:
> >> Why doesn't this happen in the call to make_rtl_for_nonlocal_decl from
> >> cp_finish_decl?
>
> > Because of this code chunk in make_rtl_for_nonlocal_decl:
> >...
> > which defers it but then actually nothing emits it.
>
> OK, then why isn't it emitted by wrapup_global_declarations?
Because nothing pushdecl's it.
If I pushdecl it, like in the patch below, wrapup_global_declarations
takes care about it:
--- cp/decl.c.jj Tue May 21 20:27:10 2002
+++ cp/decl.c Mon May 27 10:35:31 2002
@@ -6772,7 +6772,9 @@ cp_make_fname_decl (id, type_dep)
TREE_USED (decl) = 1;
cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING);
-
+ if (! current_function_decl)
+ pushdecl_with_scope (decl, global_binding_level);
+
return decl;
}
Jakub