Does const reference have external linkage in C++?
The reference itself isn't const
, just the object it refers to; so (arguably) this rule doesn't give the reference internal linkage.
It doesn't make sense for a reference to be declared const
. The C++11 standard clarifies the wording:
a variable that is explicitly declared
const
orconstexpr
and neither explicitly declaredextern
nor previously declared to have external linkage
with no mention of the nonsensical concept of references declared const
.