2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -verify %s
|
2009-03-20 02:15:34 +08:00
|
|
|
|
2015-08-22 04:28:16 +08:00
|
|
|
@protocol Protocol
|
|
|
|
- (oneway void) method;
|
2009-03-20 02:15:34 +08:00
|
|
|
@end
|
|
|
|
|
2015-08-22 04:28:16 +08:00
|
|
|
void accessMethodViaPropertySyntaxAndTriggerWarning(id<Protocol> object) {
|
|
|
|
object.method; // expected-warning {{property access result unused - getters should not be used for side effects}}
|
2009-03-20 02:15:34 +08:00
|
|
|
}
|
2014-12-18 08:30:54 +08:00
|
|
|
|
|
|
|
// rdar://19137815
|
|
|
|
#pragma clang diagnostic ignored "-Wunused-getter-return-value"
|
|
|
|
|
2015-08-22 04:28:16 +08:00
|
|
|
void accessMethodViaPropertySyntaxWhenWarningIsIgnoredDoesNotTriggerWarning(id<Protocol> object) {
|
|
|
|
object.method;
|
2014-12-18 08:30:54 +08:00
|
|
|
}
|
|
|
|
|