From: Richard Smith Date: Tue, 15 Sep 2015 18:51:56 +0000 (+0000) Subject: [modules] Make sure we make hidden UsingShadowDecls visible to redeclaration X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d3e4ec2683565b6d925c73c2e3c6828a6cd4b3bc;p=clang [modules] Make sure we make hidden UsingShadowDecls visible to redeclaration lookup for the UsingShadowDecls themselves. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247714 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Sema/Lookup.h b/include/clang/Sema/Lookup.h index ed447ba149..1162a1d65a 100644 --- a/include/clang/Sema/Lookup.h +++ b/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(ND)) + if (isa(ND) && LookupKind != Sema::LookupUsingDeclName) return false; return (AllowHidden && (AllowHiddenInternal || ND->isExternallyVisible())) || diff --git a/test/Modules/Inputs/using-decl-a.h b/test/Modules/Inputs/using-decl-a.h index 85a4788e76..1d1ffe9ed3 100644 --- a/test/Modules/Inputs/using-decl-a.h +++ b/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/test/Modules/Inputs/using-decl-b.h b/test/Modules/Inputs/using-decl-b.h index b4f206fa44..7c03d09960 100644 --- a/test/Modules/Inputs/using-decl-b.h +++ b/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/test/Modules/using-decl.cpp b/test/Modules/using-decl.cpp index f01688498c..1677585dda 100644 --- a/test/Modules/using-decl.cpp +++ b/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 {