PushDeclContext(S, Tag);
ActOnDocumentableDecl(TagD);
+
+ // If there's a #pragma GCC visibility in scope, set the visibility of this
+ // record.
+ AddPushedVisibilityAttribute(Tag);
}
Decl *Sema::ActOnObjCContainerStartDefinition(Decl *IDecl) {
if (isa<CXXRecordDecl>(Tag))
FieldCollector->FinishClass();
- // If there's a #pragma GCC visibility in scope, and this isn't a subclass,
- // set the visibility of this record.
- AddPushedVisibilityAttribute(Tag);
-
// Exit this scope of this tag's definition.
PopDeclContext();
// CHECK: declare hidden void @_ZN6test536vectorINS_3zedEE14_M_fill_insertEv
// CHECK-HIDDEN: declare hidden void @_ZN6test536vectorINS_3zedEE14_M_fill_insertEv
}
+
+namespace test54 {
+ template <class T>
+ struct foo {
+ static void bar();
+ };
+#pragma GCC visibility push(hidden)
+ class zed {
+ zed(const zed &);
+ };
+ void bah() {
+ foo<zed>::bar();
+ }
+#pragma GCC visibility pop
+ // CHECK: declare hidden void @_ZN6test543fooINS_3zedEE3barEv
+ // CHECK-HIDDEN: declare hidden void @_ZN6test543fooINS_3zedEE3barEv
+}