]> granicus.if.org Git - clang/commitdiff
[ASTImporter] Call to HandleNameConflict in VisitRecordDecl mistakeningly using Name...
authorShafik Yaghmour <syaghmour@apple.com>
Fri, 24 May 2019 16:53:44 +0000 (16:53 +0000)
committerShafik Yaghmour <syaghmour@apple.com>
Fri, 24 May 2019 16:53:44 +0000 (16:53 +0000)
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

lib/AST/ASTImporter.cpp

index 74a1887753c576298651a175617ba17a828b78a4..2b7470410f720057938a8ef9dabd47587eab5714 100644 (file)
@@ -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)