mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-25 14:28:54 -04:00

-Wobjc-messaging-id is a new, non-default warning that warns about message sends to unqualified id in Objective-C. This warning is useful for projects that would like to avoid any potential future compiler errors/warnings, as the system frameworks might add a method with the same selector which could make the message send to id ambiguous. rdar://33303354 llvm-svn: 311779
22 lines
537 B
Plaintext
22 lines
537 B
Plaintext
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class -Wobjc-messaging-id %s
|
|
|
|
@interface CallMeMaybe
|
|
|
|
- (void)doThing:(int)intThing;
|
|
|
|
@property int thing;
|
|
|
|
@end
|
|
|
|
template<typename T>
|
|
void instantiate(const T &x) {
|
|
[x setThing: 22]; // expected-warning {{messaging unqualified id}}
|
|
}
|
|
|
|
void fn() {
|
|
id myObject;
|
|
[myObject doThing: 10]; // expected-warning {{messaging unqualified id}}
|
|
[myObject setThing: 11]; // expected-warning {{messaging unqualified id}}
|
|
instantiate(myObject); // expected-note {{in instantiation}}
|
|
}
|