[cfe-commits] r150704 - in /cfe/trunk: lib/Sema/SemaTemplateInstantiateDecl.cpp test/SemaCXX/warn-thread-safety-analysis.cpp

DeLesley Hutchins delesley at google.com
Thu Feb 16 09:30:51 PST 2012


Author: delesley
Date: Thu Feb 16 11:30:51 2012
New Revision: 150704

URL: http://llvm.org/viewvc/llvm-project?rev=150704&view=rev
Log:
Minor fix to template instantiation, which properly instantiates
dependent attributes on static members of templatized classes.

Modified:
    cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
    cfe/trunk/test/SemaCXX/warn-thread-safety-analysis.cpp

Modified: cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp?rev=150704&r1=150703&r2=150704&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaTemplateInstantiateDecl.cpp Thu Feb 16 11:30:51 2012
@@ -326,7 +326,7 @@
     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.

Modified: cfe/trunk/test/SemaCXX/warn-thread-safety-analysis.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/warn-thread-safety-analysis.cpp?rev=150704&r1=150703&r2=150704&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/warn-thread-safety-analysis.cpp (original)
+++ cfe/trunk/test/SemaCXX/warn-thread-safety-analysis.cpp Thu Feb 16 11:30:51 2012
@@ -1847,6 +1847,7 @@
 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 @@
   }
 
   Mutex mu_;
+  static Mutex static_mu_;
 };
 
 void testDelayed() {





More information about the cfe-commits mailing list