| 1 | // RUN: %clang_cc1 -verify %s |
| 2 | |
| 3 | @protocol Protocol |
| 4 | - (oneway void) method; |
| 5 | @end |
| 6 | |
| 7 | void accessMethodViaPropertySyntaxAndTriggerWarning(id<Protocol> object) { |
| 8 | object.method; // expected-warning {{property access result unused - getters should not be used for side effects}} |
| 9 | } |
| 10 | |
| 11 | // rdar://19137815 |
| 12 | #pragma clang diagnostic ignored "-Wunused-getter-return-value" |
| 13 | |
| 14 | void accessMethodViaPropertySyntaxWhenWarningIsIgnoredDoesNotTriggerWarning(id<Protocol> object) { |
| 15 | object.method; |
| 16 | } |
| 17 | |
| 18 | |