Yuck! the attempt to fix friend lookup bug failed because it was based on lookup_tag function. It could only find types and completely ignore typedef and template type parameter, so it can't diagnose invalid codes like:
template <class T> class A {
typedef int U;
friend class T; // Invalid
friend class U; // Invalid
};
Now I have to figure out the implementation based on lookup_name function which will find all such names. And the result will have to be checked for validity. :(
