aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaDecl.cpp3
-rw-r--r--test/CodeGenCXX/visibility.cpp13
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp
index f9a487270b..576cbd150a 100644
--- a/lib/Sema/SemaDecl.cpp
+++ b/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/test/CodeGenCXX/visibility.cpp b/test/CodeGenCXX/visibility.cpp
index a398a45e58..60a77927ff 100644
--- a/test/CodeGenCXX/visibility.cpp
+++ b/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
+}