Minor fix to template instantiation, which properly instantiates

dependent attributes on static members of templatized classes.

llvm-svn: 150704
This commit is contained in:
DeLesley Hutchins 2012-02-16 17:30:51 +00:00
parent b0d75c2f4e
commit 6f13b09a00
2 changed files with 3 additions and 1 deletions

View 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.

View 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() {