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

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



------- Comment #5 from igodard at pacbell dot net  2009-11-06 18:22 -------
That argument (warn about unreferenceable names with external linkage) applies
here to enum A. However, because enum D is inside the anonymous namespace it
cannot be referenced from another unit anyway and so must have local (i.e.
static) linkage. Hence, as suggested by my original report, it seems reasonable
that there should be no warning on D.

Or am I misunderstanding the implications of the anonymous namespace, which I
had understood to be the C++ replacement for C's "static"? That is, in your
second example, isn't the "static" on D redundant?


-- 


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



More information about the Gcc-bugs mailing list