1 // RUN: %clang_cc1 -verify %s \
2 // RUN: -fblocks -fobjc-exceptions -fexceptions -fsyntax-only \
3 // RUN: -Wno-unused-value -Wno-unused-getter-return-value
5 #if !__has_extension(statement_attributes_with_gnu_syntax)
6 #error "We should have statement attributes with GNU syntax support"
12 @interface Test : Base
13 @property(getter=hasFoobar) int foobar;
21 - (void)foo __attribute__((nomerge)) {
22 // expected-error@-1 {{'nomerge' attribute only applies to functions and statements}}
26 __attribute__(()) [self foo];
27 // expected-error@-1 {{missing '[' at start of message send expression}}
28 // expected-error@-2 {{expected ']'}}
29 // expected-error@-3 {{expected identifier or '('}}
30 // expected-note@-4 {{to match this '['}}
31 __attribute__((nomerge)) [self foo];
32 // expected-warning@-1 {{'nomerge' attribute is ignored because there exists no call expression inside the statement}}
33 __attribute__((nomerge)) [getTest() foo];
35 __attribute__(()) ^{};
36 // expected-error@-1 {{expected identifier or '('}}
37 __attribute__((nomerge)) ^{};
38 // expected-warning@-1 {{'nomerge' attribute is ignored because there exists no call expression inside the statement}}
39 __attribute__((nomerge)) ^{ [self foo]; }();
41 __attribute__(()) @try {
46 __attribute__((nomerge)) @try {
51 __attribute__((nomerge)) (__bridge void *)self;
52 // expected-warning@-1 {{'nomerge' attribute is ignored because there exists no call expression inside the statement}}
54 __attribute__((nomerge)) self.hasFoobar;
55 // expected-warning@-1 {{'nomerge' attribute is ignored because there exists no call expression inside the statement}}