Function specializations used in friend declarations in class templates, like:
template<typename T> class C1 { friend void func<>(int);
previously were processed incorrectly: class instantiation made them ordinary
functions and they were not placed into redeclaration chains correctly. This
change repairs specialization treatment.
This change fixes PR12994.