crash with explicit instantiation (PR24629)

The following code will crash the clang:

template
struct X {
void bar(T t) {}
void foo(T t, int i) {}

template
void foo(T t, U i) {}
};

template class X;
template void X::bar(double t); // error, reports duplicate

template void X::foo(double t, int i); // crashes, but should report duplicate

template void X::foo(double t, int i); // crashes, but should be okay

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.

But if I just use them without explicit instantiation, they work as expected, e.g.:

X x;
x.bar(1.2);
x.foo(1.2, 1);
x.foo(1.2, 1);

With the non-templatized version of foo() taking precidence.

Before I make a run at fixing this, I just wanted to make sure I was doing the right thing.

thanks…
don

Submitted http://reviews.llvm.org/D17215