[Bug c++/41970] New: Unjustified "anonymous type" warning

igodard at pacbell dot net gcc-bugzilla@gcc.gnu.org
Fri Nov 6 13:45:00 GMT 2009


This code:

enum {a, b, c} A = a;
namespace {
    enum {d, e, f} D = d;
    }
int main() { return 0; }

gets you:

foo.cc:1: warning: non-local variable ‘<anonymous enum> A’ uses anonymous type
foo.cc:3: warning: non-local variable ‘<unnamed>::<anonymous enum>
<unnamed>::DÂ’ uses anonymous type

As A is local and D is not, it seems that one of the warnings is wrong. Or
maybe the warning doesn't mean what it appears to mean, in which case please
consider this to be a report about an incomprehensible diagnostic.


-- 
           Summary: Unjustified "anonymous type" warning
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net


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



More information about the Gcc-bugs mailing list