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: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Aug 2007 03:15:04 -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 #38 from bangerth at dealii dot org 2007-08-29 03:15 -------
(In reply to comment #37)
> No it is not, it is still violating One definition rule as struct X
> will have a different member type for pimpl_ in each TU (this violates
> the whole idea of types being exported).
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 :-)
> This warning is not about style, it is about warning when you are most
> likely going to violat C++'s One definition rule with anonymous
> namespaces and you do violate it here as explained above.
Yes, I agree that whoever uses this idiom is walking a very fine line
indeed, and most definitely is violating at least good style. I can certainly
live with a warning.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29365