"H.J. Lu" <hjl.to...@gmail.com> writes:

> It may be a known issue. Does gcc follow Section 5.1.6 Scope Encoding
> in C++ ABI:
>
> http://www.codesourcery.com/public/cxx-abi/abi.html#mangling
>
> I tried the example. But it won't compile. I changed it to:
>
> [...@gnu-6 tmp]$ cat x.cc
>   namespace N {
>       inline char f(int i) {
>          static const char *p = "Itanium C++ ABI";  // p = 1, "..." = 2
>          {  struct X {                      // X = 3
>                void g() {}
>             };   }
>          return p[i];
>       }
>       char
>       foo (int i)
>       {
>         return f (i);
>       }
>    }
> [...@gnu-6 tmp]$ gcc -c x.cc
> [...@gnu-6 tmp]$ nm x.o
> 0000000000000000 W _ZN1N1fEi
> 0000000000000000 T _ZN1N3fooEi
> 0000000000000000 V _ZZN1N1fEiE1p
>                  U __gxx_personality_v0
> [...@gnu-6 tmp]$ nm x.o | c++filt
> 0000000000000000 W N::f(int)
> 0000000000000000 T N::foo(int)
> 0000000000000000 V N::f(int)::p
>                  U __gxx_personality_v0
> [...@gnu-6 tmp]$
>
> It doesn't
>
> "_ZZN1N1fEiEs": encoding of N::f::"Itanium C++ ABI" (no discriminator)

The discriminator is optional and is up to the discretion of the
compiler.  This doesn't matter for interoperability purposes, because
such names can not be referenced from other translation units anyhow.

What do you think the symbol name should be?

Ian

Reply via email to