diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-09-15 01:28:55 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-09-15 01:28:55 +0000 |
commit | f091e129dbf75f5e52bf5ff000d4fd049cc9c06c (patch) | |
tree | 95b2fc69eec070cb2ca0d87896738800c3fd2ab7 /clang/lib/Sema/SemaOverload.cpp | |
parent | ca5ab2b0d4d975402d07511ad6b6a14fc47ee68c (diff) | |
download | bcm5719-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/SemaOverload.cpp')
-rw-r--r-- | clang/lib/Sema/SemaOverload.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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 |