Extended Description
We're failing to instantiate the initializer for a variable template specialization if its type has internal linkage:
<stdin>:1:24: warning: variable 'var<<anonymous namespace>::S>' has internal linkage but is not defined [-Wundefined-internal]
template<typename T> T var; namespace { struct S {} s = var<S>; }
^
<stdin>:1:57: note: used here
template<typename T> T var; namespace { struct S {} s = var<S>; }
^
The warning is sort of right: if we emit IR for s, we emit it as external global.