Internal linkage

The following kinds of identifiers have internal linkage:
  • Objects, references, or functions explicitly declared static
  • Objects or references declared in global scope with the specifier const and neither explicitly declared extern, nor previously declared to have external linkage
  • Data members of an anonymous union

A function declared inside a block will usually have external linkage. An object declared inside a block will usually have external linkage if it is specified extern. If a variable that has static storage is defined outside a function, the variable has internal linkage and is available from the point where it is defined to the end of the current translation unit.

If the declaration of an identifier has the keyword extern and if a previous declaration of the identifier is visible at namespace or global scope, the identifier has the same linkage as the first declaration.