[Bug c++/56641] [4.7/4.8 regression] Bogus warning: 'A' has a field 'A::e' whose type uses the anonymous namespace

ppluzhnikov at google dot com gcc-bugzilla@gcc.gnu.org
Sun Mar 17 19:42:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56641

Paul Pluzhnikov <ppluzhnikov at google dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID

--- Comment #2 from Paul Pluzhnikov <ppluzhnikov at google dot com> 2013-03-17 19:42:28 UTC ---
Thanks for the explanation.

The actual use case looks like this:

// test-skeleton.cc
namespace { enum E { }; }
struct A { E e; };
//... other common test skeleton code ...

// foo-test.cc
#include "test-skeleton.cc"
//... specific foo tests


The workaround is to either make 'enum E' global, or name the namespace.



More information about the Gcc-bugs mailing list