jfb added a comment.
I reduced the code I had to this:
struct __attribute__((capability("mutex"))) MyLock {
void lock() __attribute__((acquire_capability())) {}
void unlock() __attribute__((release_capability())) {}
};
template <class T> struct __attribute__((scoped_lockable)) Locker {
T &_l;
Locker(T &l) __attribute__((acquire_capability(l))) : _l(l) { _l.lock(); }
~Locker() __attribute__((release_capability())) { _l.unlock(); }
};
struct MyLockable {
MyLock lock;
};
@protocol MyProtocolBase;
@protocol MyProtocol <MyProtocolBase>
@end
@interface MyProtocol
@end
@interface MyProtocol ()
- (void)doIt:(struct MyLockable *)myLockable;
@end
@implementation MyProtocol
- (void)doIt:(struct MyLockable *)myLockable {
Locker<MyLock> lock(myLockable->lock);
}
@end
But now it doesn't repro... I probably missed something important :)
Repository:
rC Clang
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D59523/new/
https://reviews.llvm.org/D59523
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits