Skip to content

Commit

Permalink
[ASTImporter] Call to HandleNameConflict in VisitEnumDecl mistakening…
Browse files Browse the repository at this point in the history
…ly 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

llvm-svn: 357940
  • Loading branch information
shafik committed Apr 8, 2019
1 parent bf1417d commit d426312
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion clang/lib/AST/ASTImporter.cpp
Expand Up @@ -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)
Expand Down

0 comments on commit d426312

Please sign in to comment.