Process attributes in explicit function template instantiations. Fixes part of

PR11690.

llvm-svn: 147523
This commit is contained in:
Rafael Espindola 2012-01-04 05:40:59 +00:00
parent 36d129435e
commit 2aa7acfadb
2 changed files with 8 additions and 0 deletions

View File

@ -6407,6 +6407,9 @@ DeclResult Sema::ActOnExplicitInstantiation(Scope *S,
}
Specialization->setTemplateSpecializationKind(TSK, D.getIdentifierLoc());
AttributeList *Attr = D.getDeclSpec().getAttributes().getList();
if (Attr)
ProcessDeclAttributeList(S, Specialization, Attr);
if (TSK == TSK_ExplicitInstantiationDefinition)
InstantiateFunctionDefinition(D.getIdentifierLoc(), Specialization);

View File

@ -475,4 +475,9 @@ namespace PR11690 {
template class DEFAULT Class<char>;
// CHECK: define weak_odr void @_ZNK7PR116905ClassIcE4sizeEv
// CHECK-HIDDEN: define weak_odr void @_ZNK7PR116905ClassIcE4sizeEv
template<class T> void Method() {}
template __attribute__((visibility("default"))) void Method<char>();
// CHECK: define weak_odr void @_ZN7PR116906MethodIcEEvv
// CHECK-HIDDEN: define weak_odr void @_ZN7PR116906MethodIcEEvv
}