зеркало из https://github.com/microsoft/clang-1.git
Use the canonical template decl when trying to find if it has a visibility
attribute. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160139 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
59d7cc9e4c
Коммит
23458208b2
|
@ -702,8 +702,10 @@ llvm::Optional<Visibility> NamedDecl::getExplicitVisibility() const {
|
|||
// specialization of a class template, check for visibility
|
||||
// on the pattern.
|
||||
if (const ClassTemplateSpecializationDecl *spec
|
||||
= dyn_cast<ClassTemplateSpecializationDecl>(this))
|
||||
return getVisibilityOf(spec->getSpecializedTemplate()->getTemplatedDecl());
|
||||
= dyn_cast<ClassTemplateSpecializationDecl>(this)) {
|
||||
ClassTemplateDecl *TD = spec->getSpecializedTemplate()->getCanonicalDecl();
|
||||
return getVisibilityOf(TD->getTemplatedDecl());
|
||||
}
|
||||
|
||||
// If this is a member class of a specialization of a class template
|
||||
// and the corresponding decl has explicit visibility, use that.
|
||||
|
|
|
@ -1018,3 +1018,16 @@ namespace test54 {
|
|||
// CHECK: declare hidden void @_ZN6test543fooINS_3zedEE3barEv
|
||||
// CHECK-HIDDEN: declare hidden void @_ZN6test543fooINS_3zedEE3barEv
|
||||
}
|
||||
|
||||
namespace test55 {
|
||||
template <class T>
|
||||
struct __attribute__((visibility("hidden"))) foo {
|
||||
static void bar();
|
||||
};
|
||||
template <class T> struct foo;
|
||||
void foobar() {
|
||||
foo<int>::bar();
|
||||
}
|
||||
// CHECK: declare hidden void @_ZN6test553fooIiE3barEv
|
||||
// CHECK-HIDDEN: declare hidden void @_ZN6test553fooIiE3barEv
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче