]> granicus.if.org Git - clang/commitdiff
Process attributes in explicit template instatiation definitions. Fixes PR11690.
authorRafael Espindola <rafael.espindola@gmail.com>
Tue, 3 Jan 2012 06:04:21 +0000 (06:04 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Tue, 3 Jan 2012 06:04:21 +0000 (06:04 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147441 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplate.cpp
test/CodeGenCXX/visibility.cpp

index b0006e6ac2a3a2a64afce3efc0ff63694207c29c..e90821e451fbec773f39a0bd6a85a2778e546ce5 100644 (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.
index cfa4f4fbcf21df18519dc4da033acb04717bcdc7..54dacac99950e48a374ca53dbd9ca8c05fbbadee 100644 (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
+}