[Bug c++/70476] C++11: Function name declared in unnamed namespace extern "C" gets exernal linkage

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Mar 11 23:53:30 GMT 2023


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70476

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |assemble-failure

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I see no implementation (MSVC, GCC, clang) implements this at all.
Here is an example where GCC produces an assembly failure:
```
namespace a {
   extern "C" void f(void){}
}

namespace {
  extern "C" void f(void) {}
}

int main(void)
{
  f();
  a::f();
}
```

It might be handle to implement this even correctly too.


More information about the Gcc-bugs mailing list