diff options
author | Balazs Keri <1.int32@gmail.com> | 2019-05-27 09:36:00 +0000 |
---|---|---|
committer | Balazs Keri <1.int32@gmail.com> | 2019-05-27 09:36:00 +0000 |
commit | c8272195cd2d02cb4d626a3f64144a916bd81d95 (patch) | |
tree | bbac2a9a1eaafd0b1c989802b09c58a193eb352f /clang/lib | |
parent | 0f40585d2d532718a89972bf22ff7743c1d512bc (diff) | |
download | bcm5719-llvm-c8272195cd2d02cb4d626a3f64144a916bd81d95.tar.gz bcm5719-llvm-c8272195cd2d02cb4d626a3f64144a916bd81d95.zip |
[ASTImporter] Added visibility context check for CXXRecordDecl.
Summary:
ASTImporter makes now difference between classes with same name in different
translation units if these are not visible outside. These classes are not linked
into one decl chain.
Reviewers: martong, a.sidorin, shafik
Reviewed By: shafik
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62312
llvm-svn: 361752
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index 2b7470410f7..2e4c304b3de 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -2559,6 +2559,9 @@ ExpectedDecl ASTNodeImporter::VisitRecordDecl(RecordDecl *D) { if (!IsStructuralMatch(D, FoundRecord, false)) continue; + if (!hasSameVisibilityContext(FoundRecord, D)) + continue; + if (IsStructuralMatch(D, FoundRecord)) { RecordDecl *FoundDef = FoundRecord->getDefinition(); if (D->isThisDeclarationADefinition() && FoundDef) { |