[PATCH] D17215: [Sema] Fix PR14211 Crash for explicit instantiation of overloaded template function within class template
John McCall via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 15 15:27:50 PST 2016
rjmccall added inline comments.
================
Comment at: lib/Sema/SemaTemplate.cpp:7845
@@ -7842,1 +7844,3 @@
+ } else
+ NonTemplateMatch = Method;
}
----------------
hintonda wrote:
> rjmccall wrote:
> > Could you add an assertion here that NonTemplateMatch is still null? That should definitely never trip.
> >
> > Hmm, actually, it might trip in invalid code; you should include a test case like
> > template <class T, class U> class A { void foo(T) {} void foo(U) {} };
> > template void A<int, int>::foo(int);
> I'll add the new test, but we do check for null below, i.e., we assign NonTemplateMatch to the original Specialization pointer, and then check the matches. If we don't find one, we true on line 7883.
No, I mean an assertion that we're not re-assigning NonTemplateMatch, i.e. that we didn't find two different non-template functions like this.
http://reviews.llvm.org/D17215
More information about the cfe-commits
mailing list