This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29365] Unnecessary anonymous namespace warnings
- From: "pinskia at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2007 08:52:50 -0000
- Subject: [Bug c++/29365] Unnecessary anonymous namespace warnings
- References: <bug-29365-7796@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #39 from pinskia at gmail dot com 2007-08-29 08:52 -------
Subject: Re: Unnecessary anonymous namespace warnings
On 29 Aug 2007 03:15:04 -0000, bangerth at dealii dot org
<gcc-bugzilla@gcc.gnu.org> wrote:
> It is a good question in itself whether pimpl_ has a type at all -- it's a
> pointer to an incomplete type in any case :-)
All types in C++ are exported (well except for anonymous namespace
types) including incomplete types.
So the following two TUs are invalid when combined together.
TU1:
extern struct a *b;
TU2:
extern struct c *b;
It does not matter in C++ if it is an incomplete type because the type
is based on the name rather than compatibility rules (like what is
done for C).
So again this warning is correct based on the One definition rule.
Thanks,
Andrew Pinski
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29365