This patch fixes an an assertion that previously occurred for the following sample:
template <typename InputT, typename OutputT> struct SourceSelectionRequirement { template<typename T> OutputT evaluateSelectionRequirement(InputT &&Value) { } }; template <typename InputT, typename OutputT> OutputT SourceSelectionRequirement<InputT, OutputT>::evaluateSelectionRequirement<void>(InputT &&Value) { return Value; }
Clang asserted when it was trying to deduce the function template specialisation for evaluateSelectionRequirement, because it was trying to do deduction with the template specialisation <void> and template <typename InputT, typename OutputT> which have different template depths.
I initially fixed the issue by setting the right depth, during the deduction, but wasn't happy with the results (we produced two errors, the second one complained about failed deduction). Thus I changed my approach to the one that's presented in this patch - we can detect if the template parameters are fabricated and then avoid the deduction. This approach avoids the second error while fixing the assertion. It also fixed a redundant error FIXME in SemaTemplate/explicit-specialization-member.cpp (Basically removed a redundant deduction error).
Thanks for taking a look