Author: shafik
Date: Mon Apr  8 13:50:21 2019
New Revision: 357940

URL: http://llvm.org/viewvc/llvm-project?rev=357940&view=rev
Log:
[ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakeningly using 
Name instead of SearchName

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

Modified:
    cfe/trunk/lib/AST/ASTImporter.cpp

Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=357940&r1=357939&r2=357940&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Mon Apr  8 13:50:21 2019
@@ -2441,7 +2441,7 @@ ExpectedDecl ASTNodeImporter::VisitEnumD
     }
 
     if (!ConflictingDecls.empty()) {
-      Name = Importer.HandleNameConflict(Name, DC, IDNS,
+      Name = Importer.HandleNameConflict(SearchName, DC, IDNS,
                                          ConflictingDecls.data(),
                                          ConflictingDecls.size());
       if (!Name)


_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to