summaryrefslogtreecommitdiff
path: root/test/SemaObjC/access-property-getter.m
blob: 779274431d5fa9ae95139a1c70a94d76444b488a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %clang_cc1 -verify %s

@protocol Protocol
- (oneway void) method;
@end

void accessMethodViaPropertySyntaxAndTriggerWarning(id<Protocol> object) {
    object.method; // expected-warning {{property access result unused - getters should not be used for side effects}}
}

// rdar://19137815
#pragma clang diagnostic ignored "-Wunused-getter-return-value"

void accessMethodViaPropertySyntaxWhenWarningIsIgnoredDoesNotTriggerWarning(id<Protocol> object) {
    object.method;
}