diff options
-rw-r--r-- | lib/AST/Decl.cpp | 2 | ||||
-rw-r--r-- | test/CodeGenCXX/visibility.cpp | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index d31cf0f010..8bc9eb396e 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -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, diff --git a/test/CodeGenCXX/visibility.cpp b/test/CodeGenCXX/visibility.cpp index 568a2859f8..be4348ee93 100644 --- a/test/CodeGenCXX/visibility.cpp +++ b/test/CodeGenCXX/visibility.cpp @@ -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 +} |