Considering the following declarations

void f1( );
namespace {
void f2( );
}

both f1 and f2 have external linkage, but may f2 be referred to from scopes of other translation units?

If so, how? If no, then this constradicts the definition of "a name with external linkage":

Re: linkage of free functions? by Igor

Igor
Tue Apr 11 19:08:47 CDT 2006

"Angel Tsankov" <fn42551@fmi.uni-sofia.bg> wrote in message
news:%23ZeQ4QbXGHA.752@TK2MSFTNGP02.phx.gbl
> Considering the following declarations
>
> void f1( );
> namespace {
> void f2( );
> }
>
> both f1 and f2 have external linkage, but may f2 be referred to from
> scopes of other translation units?

No. f2 effectively has a unique compiler-generated name that other
translation units don't know and thus can't refer to. Even though
technically f2 does have external linkage.

> If so, how? If no, then this constradicts the definition of "a name
> with external linkage"

I guess it kind of does. It does not really make any practical
difference though.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925