This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28017] lack of guard variables for explicitly instantiated template static data
- From: "pinskia at physics dot uc dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jun 2006 21:47:27 -0000
- Subject: [Bug c++/28017] lack of guard variables for explicitly instantiated template static data
- References: <bug-28017-11686@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from pinskia at physics dot uc dot edu 2006-06-13 21:47 -------
Subject: Re: lack of guard variables for explicitly instantiated template
static data
>
>
>
> ------- Comment #7 from hhinnant at apple dot com 2006-06-13 21:41 -------
> (In reply to comment #6)
> > Subject: Re: lack of guard variables for explicitly instantiated template
> > static data
> >
> > > #define NEEDS_GUARD_P(decl) (TREE_PUBLIC (decl) && (DECL_COMMON (decl) \
> > > || DECL_ONE_ONLY (decl) \
> > > || DECL_WEAK (decl) \
> > > ||
> > > (!TARGET_WEAK_NOT_IN_ARCHIVE_TOC \
> > > || (! DECL_EXPLICIT_INSTANTIATION (decl) \
> > > && ! DECL_TEMPLATE_SPECIALIZATION (decl)))))
> > >
> > > ?
> >
> > The latter.
>
> Thanks. But this doesn't pass the test case on darwin. I'm not familiar
> enough with the C++ FE to understand TARGET_WEAK_NOT_IN_ARCHIVE_TOC. Could you
> double check the above. The "!" in front of DECL_EXPLICIT_INSTANTIATION looks
> especially suspicious to me.
You want the opposite of that like:
(TARGET_WEAK_NOT_IN_ARCHIVE_TOC && (DECL_EXPLICIT_INSTANTIATION (decl) ||
DECL_TEMPLATE_SPECIALIZATION (decl)))
I was quoting the case when DECL_WEAK would be set on the decl.
TARGET_WEAK_NOT_IN_ARCHIVE_TOC is only defined to 1 for darwin.
-- Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28017