From: Shafik Yaghmour Date: Fri, 24 May 2019 16:53:44 +0000 (+0000) Subject: [ASTImporter] Call to HandleNameConflict in VisitRecordDecl mistakeningly using Name... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=424619da5abb9750e772e8ea8e15e9548c47d08c;p=clang [ASTImporter] Call to HandleNameConflict in VisitRecordDecl mistakeningly using Name instead of SearchName Summary: https://reviews.llvm.org/D51633 added error handling to the ASTNodeImporter::VisitRecordDecl for the conflicting names case. This could lead to erroneous return of an error in that case since we should have been using SearchName. Name may be empty in the case where we find the name via D->getTypedefNameForAnonDecl()->getDeclName(). This fix is very similar to https://reviews.llvm.org/D59665 Differential Revision: https://reviews.llvm.org/D62352 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361650 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index 74a1887753..2b7470410f 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -2585,7 +2585,7 @@ ExpectedDecl ASTNodeImporter::VisitRecordDecl(RecordDecl *D) { } // for if (!ConflictingDecls.empty() && SearchName) { - Name = Importer.HandleNameConflict(Name, DC, IDNS, + Name = Importer.HandleNameConflict(SearchName, DC, IDNS, ConflictingDecls.data(), ConflictingDecls.size()); if (!Name)