[C++ PATCH] Fix __PRETTY_FUNCTION__ (PR c++/6794)

Jakub Jelinek jakub@redhat.com
Sun May 26 12:09:00 GMT 2002


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:

  /* We try to defer namespace-scope static constants so that they are
     not emitted into the object file unnecessarily.  */
  if (!DECL_VIRTUAL_P (decl)
      && TREE_READONLY (decl)
      && DECL_INITIAL (decl) != NULL_TREE
      && DECL_INITIAL (decl) != error_mark_node
      && ! EMPTY_CONSTRUCTOR_P (DECL_INITIAL (decl))
      && toplev
      && !TREE_PUBLIC (decl))
    {
      /* Fool with the linkage of static consts according to #pragma
         interface.  */
      if (!interface_unknown && !TREE_PUBLIC (decl))
        {
          TREE_PUBLIC (decl) = 1;
          DECL_EXTERNAL (decl) = interface_only;
        }

      defer_p = 1;
    }

which defers it but then actually nothing emits it.
If this if contained an !DECL_ARTIFICIAL (decl) check, it would work
well too, but I don't know if that's what we want to do with all
artificial static constants.

	Jakub



More information about the Gcc-patches mailing list