diff options
author | DeLesley Hutchins <delesley@google.com> | 2015-09-29 16:24:18 +0000 |
---|---|---|
committer | DeLesley Hutchins <delesley@google.com> | 2015-09-29 16:24:18 +0000 |
commit | 2b504dce14ef817a6a3f83cedee9f6f20066a93d (patch) | |
tree | 9bfaa0593852ff43fd66631913c4bdb7189570d1 /clang/lib/Sema | |
parent | 32d4d37e614f005e981f61ad278808f6da213bca (diff) | |
download | bcm5719-llvm-2b504dce14ef817a6a3f83cedee9f6f20066a93d.tar.gz bcm5719-llvm-2b504dce14ef817a6a3f83cedee9f6f20066a93d.zip |
Thread Safety Analysis: allow capability attribute on unions.
llvm-svn: 248805
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 9cc082152bb..8218c20696d 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -628,13 +628,10 @@ static bool checkAcquireOrderAttrCommon(Sema &S, Decl *D, // Check that this attribute only applies to lockable types. QualType QT = cast<ValueDecl>(D)->getType(); - if (!QT->isDependentType()) { - const RecordType *RT = getRecordType(QT); - if (!RT || !RT->getDecl()->hasAttr<CapabilityAttr>()) { - S.Diag(Attr.getLoc(), diag::warn_thread_attribute_decl_not_lockable) - << Attr.getName(); - return false; - } + if (!QT->isDependentType() && !typeHasCapability(S, QT)) { + S.Diag(Attr.getLoc(), diag::warn_thread_attribute_decl_not_lockable) + << Attr.getName(); + return false; } // Check that all arguments are lockable objects. |