[ASTImporter] Fix for import of friend class template with definition.
authorBalazs Keri <1.int32@gmail.com>
Mon, 12 Aug 2019 10:07:38 +0000 (10:07 +0000)
committerBalazs Keri <1.int32@gmail.com>
Mon, 12 Aug 2019 10:07:38 +0000 (10:07 +0000)
commit2e16060a8bbbd82f4637ddb5e58533a614ef529e
treeddc21079b8cf92dec43415dd982988223b0adb24
parent3cafdfddcbcd077325622dd0869b409f4664769e
[ASTImporter] Fix for import of friend class template with definition.

Summary:
If there is a friend class template "prototype" (forward declaration)
and later a definition for it in the existing code, this existing
definition may be not found by ASTImporter because it is not linked
to the prototype (under the friend AST node). The problem is fixed by
looping over all found matching decls instead of break after the first
found one.

Reviewers: martong, a.sidorin, shafik, a_sidorin

Reviewed By: a_sidorin

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D65269

llvm-svn: 368551
clang/lib/AST/ASTImporter.cpp
clang/unittests/AST/ASTImporterTest.cpp