For the following snippet:
#if __has_attribute(capability)
#define LOCKABLE(name) __attribute__((capability(name)))
#endif
#if __has_attribute(unlock_function)
#define UNLOCK_FUNCTION(...) __attribute__((unlock_function(__VA_ARGS__)))
#endif
struct LOCKABLE("M") M {
void unlock() UNLOCK_FUNCTION();
};
class L {
public:
void f() UNLOCK_FUNCTION(this->mutex_) { this->mutex_.unlock(); }
private:
M mutex_;
};
#67780 changed the behavior where it would insert extra spaces around the arrow in the annotation, so the following:
void f() UNLOCK_FUNCTION(this->mutex_) { this->mutex_.unlock(); }
becomes:
void f() UNLOCK_FUNCTION(this -> mutex_) { this->mutex_.unlock(); }