]> granicus.if.org Git - clang/commitdiff
Minor fix to template instantiation, which properly instantiates
authorDeLesley Hutchins <delesley@google.com>
Thu, 16 Feb 2012 17:30:51 +0000 (17:30 +0000)
committerDeLesley Hutchins <delesley@google.com>
Thu, 16 Feb 2012 17:30:51 +0000 (17:30 +0000)
dependent attributes on static members of templatized classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150704 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaTemplateInstantiateDecl.cpp
test/SemaCXX/warn-thread-safety-analysis.cpp

index fb771aa30b996c318007ae34b74d2bddbc0d218e..f480825412307b093e8423c053a6b8e096f4b4f0 100644 (file)
@@ -326,7 +326,7 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) {
     if (Owner->isFunctionOrMethod())
       SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Var);
   }
-  SemaRef.InstantiateAttrs(TemplateArgs, D, Var);
+  SemaRef.InstantiateAttrs(TemplateArgs, D, Var, LateAttrs, StartingScope);
 
   // Link instantiations of static data members back to the template from
   // which they were instantiated.
index 58f351fcd82b5b4779443fc3072615e7415d62f6..8bbaf0398fae3b9e041681d8e167ad2087ddc8c1 100644 (file)
@@ -1847,6 +1847,7 @@ class CellDelayed {
 public:
   // Test dependent guarded_by
   T data GUARDED_BY(mu_);
+  static T static_data GUARDED_BY(static_mu_);
 
   void fooEx(CellDelayed<T> *other) EXCLUSIVE_LOCKS_REQUIRED(mu_, other->mu_) {
     this->data = other->data;
@@ -1864,6 +1865,7 @@ public:
   }
 
   Mutex mu_;
+  static Mutex static_mu_;
 };
 
 void testDelayed() {