r247714 - [modules] Make sure we make hidden UsingShadowDecls visible to redeclaration
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 15 11:51:57 PDT 2015
Author: rsmith
Date: Tue Sep 15 13:51:56 2015
New Revision: 247714
URL: http://llvm.org/viewvc/llvm-project?rev=247714&view=rev
Log:
[modules] Make sure we make hidden UsingShadowDecls visible to redeclaration
lookup for the UsingShadowDecls themselves.
Modified:
cfe/trunk/include/clang/Sema/Lookup.h
cfe/trunk/test/Modules/Inputs/using-decl-a.h
cfe/trunk/test/Modules/Inputs/using-decl-b.h
cfe/trunk/test/Modules/using-decl.cpp
Modified: cfe/trunk/include/clang/Sema/Lookup.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/Lookup.h?rev=247714&r1=247713&r2=247714&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/Lookup.h (original)
+++ cfe/trunk/include/clang/Sema/Lookup.h Tue Sep 15 13:51:56 2015
@@ -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())) ||
Modified: cfe/trunk/test/Modules/Inputs/using-decl-a.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/using-decl-a.h?rev=247714&r1=247713&r2=247714&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/using-decl-a.h (original)
+++ cfe/trunk/test/Modules/Inputs/using-decl-a.h Tue Sep 15 13:51:56 2015
@@ -1,5 +1,6 @@
typedef int using_decl_type;
int using_decl_var;
+int merged;
namespace UsingDecl {
using ::using_decl_type;
Modified: cfe/trunk/test/Modules/Inputs/using-decl-b.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/Inputs/using-decl-b.h?rev=247714&r1=247713&r2=247714&view=diff
==============================================================================
--- cfe/trunk/test/Modules/Inputs/using-decl-b.h (original)
+++ cfe/trunk/test/Modules/Inputs/using-decl-b.h Tue Sep 15 13:51:56 2015
@@ -8,6 +8,7 @@ namespace UsingDecl {
namespace UsingDecl {
using ::using_decl_type;
using ::using_decl_var;
+ using ::merged;
}
namespace X {
Modified: cfe/trunk/test/Modules/using-decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Modules/using-decl.cpp?rev=247714&r1=247713&r2=247714&view=diff
==============================================================================
--- cfe/trunk/test/Modules/using-decl.cpp (original)
+++ cfe/trunk/test/Modules/using-decl.cpp Tue Sep 15 13:51:56 2015
@@ -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 {
More information about the cfe-commits
mailing list