How does the linker handle identical template instantiations across translation units? : <p>Suppose I have two translation-units: </p>

<p>foo.cpp</p>

<pre><code>void foo() {
  auto v = std::vector&lt;int&gt;();
}
</code></pre>

<p>bar.cpp</p>

<pre><code>void bar() {
  auto v = std::vector&lt;int&gt;();
}
</code></pre>

<p>When I compile these translation-units, each will instantiate <code>std::vector&lt;int&gt;</code>. </p>

<p>My question is: how does this work at the linking stage? </p>

<ul>
<li>Do both instantiations have different mangled names? </li>
<li>Does the linker remove them as duplicates?</li>
</ul>
