llvm-capstone/clang/test/SemaObjCXX/no-crash-thread-safety-analysis.mm
JF Bastien cefafc4999 Thread Safety: also look at ObjC methods
Summary:
SExprBuilder::translateDeclRefExpr was only looking at FunctionDecl and not also looking at ObjCMethodDecl. It should consider both because the attributes can be used on Objective-C as well.

<rdar://problem/48941331>

Reviewers: dexonsmith, erik.pilkington

Subscribers: jkorous, jdoerfert, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D59523

llvm-svn: 356940
2019-03-25 20:06:32 +00:00

16 lines
342 B
Plaintext

// RUN: %clang_cc1 -fsyntax-only -Wthread-safety -Wno-objc-root-class %s
// Thread safety analysis used to crash when used with ObjC methods.
#include "thread-safety-analysis.h"
@interface MyInterface
- (void)doIt:(class Lock *)myLock;
@end
@implementation MyInterface
- (void)doIt:(class Lock *)myLock {
AutoLock lock(*myLock);
}
@end