diff options
author | John McCall <rjmccall@apple.com> | 2010-11-02 18:38:13 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-11-02 18:38:13 +0000 |
commit | 35cebc3eea898637057b10b5cf7dd08b1d788980 (patch) | |
tree | 8591e7bd160e8935b44df4b8a6be53268509dc21 /lib/AST/Decl.cpp | |
parent | 7281d1fbea62a4549b045bb7dc434904f2b609d8 (diff) |
Unbreak private_extern, which apparently we had zero tests for.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118034 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 2eef54cf14..ca963ad7e5 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -278,11 +278,12 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) { LV.mergeVisibility(TypeLV.second); } + if (Var->getStorageClass() == SC_PrivateExtern) + LV.setVisibility(HiddenVisibility, true); + if (!Context.getLangOptions().CPlusPlus && (Var->getStorageClass() == SC_Extern || Var->getStorageClass() == SC_PrivateExtern)) { - if (Var->getStorageClass() == SC_PrivateExtern) - LV.setVisibility(HiddenVisibility, true); // C99 6.2.2p4: // For an identifier declared with the storage-class specifier @@ -307,6 +308,9 @@ static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D, LVFlags F) { // for justification). In practice, GCC doesn't do this, so it's // just too painful to make work. + if (Function->getStorageClass() == SC_PrivateExtern) + LV.setVisibility(HiddenVisibility, true); + // C99 6.2.2p5: // If the declaration of an identifier for a function has no // storage-class specifier, its linkage is determined exactly |