In the following example, we end up diffing 'A<int, 0>' against 'A<>'.
template <typename SizeType = int, SizeType = 0> struct A {}; template <typename R = A<>> R bar(); A<> &foo() { return bar(); }
It appears that we end up comparing the default argument of
'SizeType = 0' against the instantiated argument of 'int = 0'. The type
of the default argument is still dependent at this point, and this patch
bails out of the comparison at that point.
The diagnostic we ultimately give is not that great, but maybe we can
live with it:
error: non-const lvalue reference to type 'A<[...], (no argument)>' cannot bind to a temporary of type 'A<[...], 0>'