Produce a hidden symbol for zed in

struct HIDDEN foo {
  };
  template <class P>
  struct bar {
  };
  template <>
  struct HIDDEN bar<foo> {
    DEFAULT static void zed();
  };
  void bar<foo>::zed() {
  }

Before we would produce a hidden symbol in

  struct HIDDEN foo {
  };
  template <class P>
  struct bar {
  };
  template <>
  struct bar<foo> {
    DEFAULT static void zed();
  };
  void bar<foo>::zed() {
  }

But adding HIDDEN to the specialization would cause us to produce a default
symbol.

llvm-svn: 157206
This commit is contained in:
Rafael Espindola 2012-05-21 20:15:56 +00:00
parent 3169e80603
commit 93c289c28a
2 changed files with 17 additions and 1 deletions

View File

@ -163,7 +163,7 @@ static bool shouldConsiderTemplateLV(const FunctionDecl *fn) {
}
static bool shouldConsiderTemplateLV(const ClassTemplateSpecializationDecl *d) {
return !d->hasAttr<VisibilityAttr>();
return !d->hasAttr<VisibilityAttr>() || d->isExplicitSpecialization();
}
static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D,

View File

@ -789,3 +789,19 @@ namespace test39 {
// GCC produces a default for this one. Why?
// CHECK-HIDDEN: define weak_odr hidden void @_ZN6test391AINS_8hidden_tEE1BIS1_E4tempIS1_EEvv
}
namespace test42 {
struct HIDDEN foo {
};
template <class P>
struct bar {
};
template <>
struct HIDDEN bar<foo> {
DEFAULT static void zed();
};
void bar<foo>::zed() {
}
// CHECK: define hidden void @_ZN6test423barINS_3fooEE3zedEv
// CHECK-HIDDEN: define hidden void @_ZN6test423barINS_3fooEE3zedEv
}