https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70476
--- Comment #11 from Maciej S. Szmigiero <mail at maciej dot szmigiero.name> --- (In reply to Andrew Pinski from comment #9) > Does these two functions the same name then? > ``` > namespace a { > extern "C" void f(void); > } > > namespace { > extern "C" void f(void) {} > } > > void g(void) > { > f(); > a::f(); > } > > ``` > It seems counter intuitive that a::f and the ::f map to different functions. According to [dcl.link] "Two declarations for a function with C language linkage with the same function name (ignoring the namespace names that qualify it) that appear in different namespace scopes refer to the same function", so it would seem that both refer to the same function indeed. > Here is an example where GCC produces an assembly failure: > > namespace a { > extern "C" void f(void){} > } > > namespace { > extern "C" void f(void) {} > } If they are the same function then this shouldn't work (it would be a re-definition).