[cfe-commits] r147441 - in /cfe/trunk: lib/Sema/SemaTemplate.cpp test/CodeGenCXX/visibility.cpp
Rafael Espindola
rafael.espindola at gmail.com
Mon Jan 2 22:04:22 PST 2012
Author: rafael
Date: Tue Jan 3 00:04:21 2012
New Revision: 147441
URL: http://llvm.org/viewvc/llvm-project?rev=147441&view=rev
Log:
Process attributes in explicit template instatiation definitions. Fixes PR11690.
Modified:
cfe/trunk/lib/Sema/SemaTemplate.cpp
cfe/trunk/test/CodeGenCXX/visibility.cpp
Modified: cfe/trunk/lib/Sema/SemaTemplate.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplate.cpp?rev=147441&r1=147440&r2=147441&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplate.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplate.cpp Tue Jan 3 00:04:21 2012
@@ -5988,6 +5988,9 @@
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.
Modified: cfe/trunk/test/CodeGenCXX/visibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/visibility.cpp?rev=147441&r1=147440&r2=147441&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/visibility.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/visibility.cpp Tue Jan 3 00:04:21 2012
@@ -466,3 +466,13 @@
// 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
+}
More information about the cfe-commits
mailing list