Process attributes in explicit template instatiation definitions. Fixes PR11690.

llvm-svn: 147441
This commit is contained in:
Rafael Espindola 2012-01-03 06:04:21 +00:00
parent 3a5ff5cbd2
commit 0b0620776a
2 changed files with 13 additions and 0 deletions

View File

@ -5988,6 +5988,9 @@ Sema::ActOnExplicitInstantiation(Scope *S,
Specialization->setExternLoc(ExternLoc);
Specialization->setTemplateKeywordLoc(TemplateLoc);
if (Attr)
ProcessDeclAttributeList(S, Specialization, Attr);
// Add the explicit instantiation into its lexical context. However,
// since explicit instantiations are never found by name lookup, we
// just put it into the declaration context directly.

View File

@ -466,3 +466,13 @@ namespace PR10113 {
// CHECK: define weak_odr void @_ZN7PR101133foo3barIcE3zedEv
// CHECK-HIDDEN: define weak_odr void @_ZN7PR101133foo3barIcE3zedEv
}
namespace PR11690 {
template<class T> struct Class {
void size() const {
}
};
template class DEFAULT Class<char>;
// CHECK: define weak_odr void @_ZNK7PR116905ClassIcE4sizeEv
// CHECK-HIDDEN: define weak_odr void @_ZNK7PR116905ClassIcE4sizeEv
}