1// RUN: %clang_cc1 %s -verify -fno-builtin 2 3_Static_assert(__has_feature(attribute_diagnose_if_objc), "feature check failed?"); 4 5#define _diagnose_if(...) __attribute__((diagnose_if(__VA_ARGS__))) 6 7@interface I 8-(void)meth _diagnose_if(1, "don't use this", "warning"); // expected-note 1{{from 'diagnose_if'}} 9@property (assign) id prop _diagnose_if(1, "don't use this", "warning"); // expected-note 2{{from 'diagnose_if'}} 10@end 11 12void test(I *i) { 13 [i meth]; // expected-warning {{don't use this}} 14 id o1 = i.prop; // expected-warning {{don't use this}} 15 id o2 = [i prop]; // expected-warning {{don't use this}} 16} 17