summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-09-15 01:28:55 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-09-15 01:28:55 +0000
commitf091e129dbf75f5e52bf5ff000d4fd049cc9c06c (patch)
tree95b2fc69eec070cb2ca0d87896738800c3fd2ab7 /clang/lib/Sema
parentca5ab2b0d4d975402d07511ad6b6a14fc47ee68c (diff)
downloadbcm5719-llvm-f091e129dbf75f5e52bf5ff000d4fd049cc9c06c.tar.gz
bcm5719-llvm-f091e129dbf75f5e52bf5ff000d4fd049cc9c06c.zip
[modules] A using-declaration doesn't introduce a new entity, just a new name
for an existing entity, and as such a using-declaration doesn't need to conflict with a hidden entity (nor vice versa). llvm-svn: 247654
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp3
-rw-r--r--clang/lib/Sema/SemaOverload.cpp5
2 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index e80cde76e10..ff9c93d2f69 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -7821,7 +7821,8 @@ bool Sema::CheckUsingShadowDecl(UsingDecl *Using, NamedDecl *Orig,
FoundEquivalentDecl = true;
}
- (isa<TagDecl>(D) ? Tag : NonTag) = D;
+ if (isVisible(D))
+ (isa<TagDecl>(D) ? Tag : NonTag) = D;
}
if (FoundEquivalentDecl)
diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp
index 34a03abb96f..0ba55983015 100644
--- a/clang/lib/Sema/SemaOverload.cpp
+++ b/clang/lib/Sema/SemaOverload.cpp
@@ -896,6 +896,11 @@ Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old,
OldD = cast<UsingShadowDecl>(OldD)->getTargetDecl();
}
+ // A using-declaration does not conflict with another declaration
+ // if one of them is hidden.
+ if ((OldIsUsingDecl || NewIsUsingDecl) && !isVisible(*I))
+ continue;
+
// If either declaration was introduced by a using declaration,
// we'll need to use slightly different rules for matching.
// Essentially, these rules are the normal rules, except that
OpenPOWER on IntegriCloud