Ericsson / clang

Cross Translation Unit analysis capability for Clang Static Analyzer. (Fork of official clang at http://llvm.org/git/clang)
http://clang.llvm.org/
Other
15 stars 10 forks source link

Improved import of same repeated friend decl. #613

Closed balazske closed 5 years ago

balazske commented 5 years ago

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.

balazske commented 4 years ago

Phabricator link: https://reviews.llvm.org/D75740