This does not fix known problem but was discovered during bug-fix.
It is valid to have friends like:
class X {
friend class Y;
friend class Y;
};
ASTImporter did not handle this case correctly, the friends were merged always. This causes later other problems: ImportDeclContext has a code to put the declarations into original order, this does not work if multiple declarations in From context are merged into one in the To (in the same DeclContext). The structural equivalence fails if the number or order of friend declarations is different, new tests were added for this.
This does not fix known problem but was discovered during bug-fix. It is valid to have friends like:
ASTImporter
did not handle this case correctly, the friends were merged always. This causes later other problems:ImportDeclContext
has a code to put the declarations into original order, this does not work if multiple declarations in From context are merged into one in the To (in the same DeclContext). The structural equivalence fails if the number or order of friend declarations is different, new tests were added for this.