]> granicus.if.org Git - clang/commitdiff
Thread safety analysis: Don't check for lockable on undefined types.
authorDeLesley Hutchins <delesley@google.com>
Thu, 16 Feb 2012 17:15:51 +0000 (17:15 +0000)
committerDeLesley Hutchins <delesley@google.com>
Thu, 16 Feb 2012 17:15:51 +0000 (17:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150702 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclAttr.cpp

index 54e7969e0d40326b8911bd0f8e196e6d9a3e8286..f0830b8861a0b1b23d786fb36efe2e511f2130b5 100644 (file)
@@ -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)