diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-09-15 18:51:56 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-09-15 18:51:56 +0000 |
| commit | ec4ad5ac9bfec9fcec7d7932a089411fb3245902 (patch) | |
| tree | c01c30b9fd37b42a32d2ca3ce3b818a2e2bb0f07 | |
| parent | 7b139762543a92a153a072ec851ca3aeea487b21 (diff) | |
| download | bcm5719-llvm-ec4ad5ac9bfec9fcec7d7932a089411fb3245902.tar.gz bcm5719-llvm-ec4ad5ac9bfec9fcec7d7932a089411fb3245902.zip | |
[modules] Make sure we make hidden UsingShadowDecls visible to redeclaration
lookup for the UsingShadowDecls themselves.
llvm-svn: 247714
| -rw-r--r-- | clang/include/clang/Sema/Lookup.h | 2 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/using-decl-a.h | 1 | ||||
| -rw-r--r-- | clang/test/Modules/Inputs/using-decl-b.h | 1 | ||||
| -rw-r--r-- | clang/test/Modules/using-decl.cpp | 6 |
4 files changed, 9 insertions, 1 deletions
diff --git a/clang/include/clang/Sema/Lookup.h b/clang/include/clang/Sema/Lookup.h index ed447ba1497..1162a1d65ab 100644 --- a/clang/include/clang/Sema/Lookup.h +++ b/clang/include/clang/Sema/Lookup.h @@ -240,7 +240,7 @@ public: // If a using-shadow declaration is hidden, it's never visible, not // even to redeclaration lookup. // FIXME: Should this apply to typedefs and namespace aliases too? - if (isa<UsingShadowDecl>(ND)) + if (isa<UsingShadowDecl>(ND) && LookupKind != Sema::LookupUsingDeclName) return false; return (AllowHidden && (AllowHiddenInternal || ND->isExternallyVisible())) || diff --git a/clang/test/Modules/Inputs/using-decl-a.h b/clang/test/Modules/Inputs/using-decl-a.h index 85a4788e764..1d1ffe9ed35 100644 --- a/clang/test/Modules/Inputs/using-decl-a.h +++ b/clang/test/Modules/Inputs/using-decl-a.h @@ -1,5 +1,6 @@ typedef int using_decl_type; int using_decl_var; +int merged; namespace UsingDecl { using ::using_decl_type; diff --git a/clang/test/Modules/Inputs/using-decl-b.h b/clang/test/Modules/Inputs/using-decl-b.h index b4f206fa443..7c03d09960e 100644 --- a/clang/test/Modules/Inputs/using-decl-b.h +++ b/clang/test/Modules/Inputs/using-decl-b.h @@ -8,6 +8,7 @@ namespace UsingDecl { namespace UsingDecl { using ::using_decl_type; using ::using_decl_var; + using ::merged; } namespace X { diff --git a/clang/test/Modules/using-decl.cpp b/clang/test/Modules/using-decl.cpp index f01688498c5..1677585ddaf 100644 --- a/clang/test/Modules/using-decl.cpp +++ b/clang/test/Modules/using-decl.cpp @@ -3,9 +3,15 @@ // RUN: %clang_cc1 -x objective-c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify -UEARLY_IMPORT // RUN: %clang_cc1 -x objective-c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify -DEARLY_IMPORT -fno-modules-hide-internal-linkage // RUN: %clang_cc1 -x objective-c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify -UEARLY_IMPORT -fno-modules-hide-internal-linkage +// RUN: %clang_cc1 -x objective-c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify -DEARLY_IMPORT -fmodules-local-submodule-visibility +// RUN: %clang_cc1 -x objective-c++ -std=c++11 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -I %S/Inputs %s -verify -UEARLY_IMPORT -fmodules-local-submodule-visibility #ifdef EARLY_IMPORT @import using_decl.a; +namespace UsingDecl { + using ::merged; +} +int k = UsingDecl::merged; #endif namespace Y { |

