<div dir="ltr"><font face="arial, helvetica, sans-serif">The following code will crash the clang:</font><div><font face="monospace, monospace"><br></font></div><div><div><font face="monospace, monospace">  template<class T></font></div><div><font face="monospace, monospace">  struct X {</font></div><div><font face="monospace, monospace">    void bar(T t) {}</font></div><div><font face="monospace, monospace">    void foo(T t, int i) {}</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">    template<class U></font></div><div><font face="monospace, monospace">    void foo(T t, U i) {}</font></div><div><font face="monospace, monospace">  };</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">  template class X<double>;</font></div><div><font face="monospace, monospace">  template void X<double>::bar(double t);  // error, reports duplicate </font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">  template void X<double>::foo(double t, int i); // crashes, but should report duplicate<br></font></div></div><div><font face="monospace, monospace"><br></font></div><div><div><font face="monospace, monospace">  template void X<double>::foo<int>(double t, int i); // crashes, but should be okay</font></div></div><div><br></div><div><br></div><div>The error for bar() is correct, since it was already explicitly instantiated by X, however, I believe the first, non-templatized, version of foo() should have the same behavior, but it crashes, as does the templatized version.</div><div><br></div><div>But if I just use them without explicit instantiation, they work as expected, e.g.:</div><div><br></div><div><font face="monospace, monospace">  X<double> x;</font></div><div><font face="monospace, monospace">  x.bar(1.2);</font></div><div><font face="monospace, monospace">  x.foo(1.2, 1);</font></div><div><font face="monospace, monospace">  x.foo<int>(1.2, 1); </font></div><div><br></div><div>With the non-templatized version of foo() taking precidence. </div><div><br></div><div>Before I make a run at fixing this, I just wanted to make sure I was doing the right thing.</div><div><br></div><div>thanks...</div><div>don</div><div><br></div><div><br></div><div><br></div></div>