summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
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
commit3509f29ec55950b6f4329fa5bc57161018413ed9 (patch)
tree2efc52d94884d12220c31de1658175fad0f183c9 /clang/lib/Sema
parentc2286f640209bc56705d09290f5479716d68f91a (diff)
downloadbcm5719-llvm-3509f29ec55950b6f4329fa5bc57161018413ed9.tar.gz
bcm5719-llvm-3509f29ec55950b6f4329fa5bc57161018413ed9.zip
Thread safety analysis: Don't check for lockable on undefined types.
llvm-svn: 150702
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclAttr.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 54e7969e0d4..f0830b8861a 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/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)
OpenPOWER on IntegriCloud