This is a simple fix that allows mutex expressions to refer to types
that are forward-declared, and thus not lockable.
http://codereview.appspot.com/5672057/
--
DeLesley Hutchins | Software Engineer | [email protected] | 505-206-0315
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 54e7969..f0830b8 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -283,6 +283,9 @@ static bool checkForLockableRecord(Sema &S, Decl *D, const AttributeList &Attr,
<< Attr.getName();
return false;
}
+ // Don't check for lockable if the class hasn't been defined yet.
+ if (RT->isIncompleteType())
+ return true;
// Flag error if the type is not lockable.
if (!RT->getDecl()->getAttr<LockableAttr>()) {
S.Diag(Attr.getLoc(), diag::err_attribute_argument_not_lockable)
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits