g++ -Wall -Wextra on namespace { enum { bar, quux } baz; }
gives as warning: testwarn.cpp:2: warning: non-local variable '<unnamed>::<anonymous enum> <unnamed>::baz' uses anonymous type I don't thing that variables in anonymous namespace should be considered as non local for the purpose of this warning. -- Summary: Spurious warning with anonymous namespace Product: gcc Version: 4.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: jm at bourguet dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33858