This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix for 10591, make variables in anonymous namespace static


Jason Merrill <jason@redhat.com> writes:

> On Thu,  4 Dec 2003 13:19:22 -0800 (PST), gkeating@apple.com (Geoffrey Keating) wrote:
> 
> > 	* decl.c (grokvardecl): Make declarations in the anonymous
> > 	namespace not be visible outside this module.
> 
> I'm dubious.  The whole point of the anonymous namespace is that
> declarations have external linkage, so that their addresses can be used as
> template arguments.  This may not be important now, but it will be once we
> implement export.

Aha!  I suspected I'd forgotten something.  I need to make sure that
instantiated templates whose names refer to the anonymous namespace
due to having a parameter from it are also made invisible outside this
module.

I also need to fix various problems like the one Gaby mentioned, by
decoupling the frontend's idea of "static" from the backend's
"!TREE_PUBLIC".


I think it'd be premature to try to anticipate an 'export'
implementation.  It seems to me that at least one possible
implementation will work just fine even if anonymous namespace
declarations are not externally visible.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]