Currently, we do not check the scope of friend classes. This can result in some
cases with missing nodes in the imported AST. E.g.:
class Container { friend class X; // A friend class ::X class X{ }; friend class X; // Friend class Container::X };
... here either ::X or Container::X is missing after importing Container.
This patch fixes the problem.
It looks like we use FriendDecl *D in other places, we should try to be consistent across the file.
I would not be against changing it but perhaps in a different PR?