llvm-project/clang/test/SemaObjC/access-property-getter.m

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
482 B
Mathematica
Raw Normal View History

// 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;
}