aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeLesley Hutchins <delesley@google.com>2012-02-16 17:15:51 +0000
committerDeLesley Hutchins <delesley@google.com>2012-02-16 17:15:51 +0000
commit634b2930f5a8fc4b153437657ce786ca3fba5b1e (patch)
tree86fe9c6ac78dd9842fb0e1021e8d0891a649136b
parent2f13bec63b0236b169b026b7bc852da51ee029a7 (diff)
Thread safety analysis: Don't check for lockable on undefined types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150702 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDeclAttr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 54e7969e0d..f0830b8861 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)