The following code causes a crash:<div><br></div><div><div>template<typename T> class vector2 {};</div><div>template<typename T> class vector : vector2<T> {};</div><div><br></div><div>template<typename T> void Foo(vector<const T*> V) {}</div>
<div><br></div><div>void test() {</div><div>  Foo(vector<int*>());</div><div>}</div></div><div><br></div><div>Once template deduction fails in vector, it tries again with with the base class vector2 and also fails, but with a different status.  However, the TemplateDeductionInfo is updated, but the old status is kept.  This leads to an assert later when the diagnostic is produced.  This patch introduces a temporary TemplateDeductionInfo to capture the information from the base class template deduction, and only overrides the old info if the template deduction is successful.</div>