// about whether containing classes have visibility attributes,
// and that's intentional.
if (TSK != TSK_ExplicitInstantiationDeclaration &&
- ConsiderGlobalVisibility && MD->isInlined() &&
- MD->getASTContext().getLangOptions().InlineVisibilityHidden)
- LV.setVisibility(HiddenVisibility);
+ ConsiderGlobalVisibility &&
+ MD->getASTContext().getLangOptions().InlineVisibilityHidden) {
+ // InlineVisibilityHidden only applies to definitions, and
+ // isInlined() only gives meaningful answers on definitions
+ // anyway.
+ const FunctionDecl *Def = 0;
+ if (MD->hasBody(Def) && Def->isInlined())
+ LV.setVisibility(HiddenVisibility);
+ }
// Note that in contrast to basically every other situation, we
// *do* apply -fvisibility to method declarations.
// CHECK: define available_externally void @_ZN2X1IfE2f2Ev
x3->f2();
}
+
+// rdar://problem/8614470
+namespace test1 {
+ struct __attribute__((visibility("default"))) A {
+ inline void foo();
+ ~A();
+ };
+
+ void test() {
+ A a;
+ a.foo();
+ }
+// CHECK: declare void @_ZN5test11A3fooEv
+// CHECK: declare void @_ZN5test11AD1Ev
+}