summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTImporter.cpp
diff options
context:
space:
mode:
authorBalazs Keri <1.int32@gmail.com>2019-07-09 11:08:18 +0000
committerBalazs Keri <1.int32@gmail.com>2019-07-09 11:08:18 +0000
commiteb79b25b4405bcdba77a7b8268a27925344d1169 (patch)
tree8a36fa0912cff818cb3e4d5b0554c83db3a4f7c9 /clang/lib/AST/ASTImporter.cpp
parentf717148b3a799c385f98aeaa5647a12fa64cdcda (diff)
downloadbcm5719-llvm-eb79b25b4405bcdba77a7b8268a27925344d1169.tar.gz
bcm5719-llvm-eb79b25b4405bcdba77a7b8268a27925344d1169.zip
[ASTImporter] Added visibility context check for EnumDecl.
Summary: ASTImporter makes now difference between enums with same name in different translation units if these are not visible outside. ("Scoped enums" are not handled yet.) Reviewers: martong, a.sidorin, shafik, a_sidorin Reviewed By: a_sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62484 llvm-svn: 365464
Diffstat (limited to 'clang/lib/AST/ASTImporter.cpp')
-rw-r--r--clang/lib/AST/ASTImporter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp
index 55d414e4e57..863a1cb0af8 100644
--- a/clang/lib/AST/ASTImporter.cpp
+++ b/clang/lib/AST/ASTImporter.cpp
@@ -2476,6 +2476,8 @@ ExpectedDecl ASTNodeImporter::VisitEnumDecl(EnumDecl *D) {
}
if (auto *FoundEnum = dyn_cast<EnumDecl>(FoundDecl)) {
+ if (!hasSameVisibilityContext(FoundEnum, D))
+ continue;
if (IsStructuralMatch(D, FoundEnum))
return Importer.MapImported(D, FoundEnum);
}
OpenPOWER on IntegriCloud