This is the mail archive of the gcc-bugs@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: [Bug c++/29365] 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


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