]> granicus.if.org Git - clang/commitdiff
[ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakeningly using Name...
authorShafik Yaghmour <syaghmour@apple.com>
Mon, 8 Apr 2019 20:50:21 +0000 (20:50 +0000)
committerShafik Yaghmour <syaghmour@apple.com>
Mon, 8 Apr 2019 20:50:21 +0000 (20:50 +0000)
Summary:
https://reviews.llvm.org/D51633 added error handling to the ASTNodeImporter::VisitEnumDecl(...) 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 getTypedefNameForAnonDecl(...).

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357940 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/ASTImporter.cpp

index e7f23cfe8fe6c07de5601d7158d8aebaac7013a3..f6e25dd8a2ae686c69da40f25ad00a78ec573da6 100644 (file)
@@ -2441,7 +2441,7 @@ ExpectedDecl ASTNodeImporter::VisitEnumDecl(EnumDecl *D) {
     }
 
     if (!ConflictingDecls.empty()) {
-      Name = Importer.HandleNameConflict(Name, DC, IDNS,
+      Name = Importer.HandleNameConflict(SearchName, DC, IDNS,
                                          ConflictingDecls.data(),
                                          ConflictingDecls.size());
       if (!Name)