This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: assembly name collisions in C++
Alex Samuel <samuel@codesourcery.com> writes:
> I believe that your code sample is illegal -- you can't declare both a
> class and a namespace foo in the same scope. The problem isn't in the
> mangling; however, it is a bug that gcc doesn't catch the double
> declaration of foo.
Thanks. I just bought a copy of the spec from the ANSI web site (much
cheaper than hardcopies I've gotten before!), and after looking at
some bits in section 7, I agree. I still want to look further at how
far the prohibition against reusing the name of a namespace goes, but
clearly my example is invalid and should be caught by the compiler.
Ken