This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: [Bug c++/29365] Unnecessary anonymous namespace warnings
- From: "Andrew Pinski" <pinskia at gmail dot com>
- To: gcc-bugzilla at gcc dot gnu dot org
- Cc: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 29 Aug 2007 01:52:32 -0700
- Subject: Re: [Bug c++/29365] Unnecessary anonymous namespace warnings
- References: <bug-29365-7796@http.gcc.gnu.org/bugzilla/> <20070829031504.14515.qmail@sourceware.org>
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