diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 3 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/visibility.cpp | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index f9a487270b8..576cbd150a4 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -10062,7 +10062,8 @@ void Sema::ActOnFields(Scope* S, // If there's a #pragma GCC visibility in scope, and this isn't a subclass, // set the visibility of this record. - if (Record && !Record->getDeclContext()->isRecord()) + if (Record && !Record->getDeclContext()->isRecord() && + !isa<ClassTemplateSpecializationDecl>(Record)) AddPushedVisibilityAttribute(Record); } diff --git a/clang/test/CodeGenCXX/visibility.cpp b/clang/test/CodeGenCXX/visibility.cpp index a398a45e585..60a77927ff0 100644 --- a/clang/test/CodeGenCXX/visibility.cpp +++ b/clang/test/CodeGenCXX/visibility.cpp @@ -974,3 +974,16 @@ namespace test52 { // CHECK: define internal void @_ZN6test523zedILPNS_12_GLOBAL__N_13fooE0EEEvv // CHECK-HIDDEN: define internal void @_ZN6test523zedILPNS_12_GLOBAL__N_13fooE0EEEvv } + +namespace test53 { + template<typename _Tp > struct vector { + static void _M_fill_insert(); + }; +#pragma GCC visibility push(hidden) + void foo() { + vector<unsigned>::_M_fill_insert(); + } +#pragma GCC visibility pop + // CHECK: declare void @_ZN6test536vectorIjE14_M_fill_insertEv + // CHECK-HIDDEN: declare void @_ZN6test536vectorIjE14_M_fill_insertEv +} |