1 // RUN: %clang_cc1 -fsyntax-only -Wthread-safety -verify %s
3 class __attribute__((shared_capability("mutex"))) Mutex
{
5 void func1() __attribute__((assert_capability(this)));
6 void func2() __attribute__((assert_capability(!this)));
8 const Mutex
& operator!() const { return *this; }
11 class NotACapability
{
13 void func1() __attribute__((assert_capability(this))); // expected-warning {{'assert_capability' attribute requires arguments whose type is annotated with 'capability' attribute; type here is 'NotACapability *'}}
14 void func2() __attribute__((assert_capability(!this))); // expected-warning {{'assert_capability' attribute requires arguments whose type is annotated with 'capability' attribute; type here is 'bool'}}
16 const NotACapability
& operator!() const { return *this; }