Alex Lorenz | d9f1284 | 2017-08-25 16:12:17 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class -Wobjc-messaging-id %s |
| 2 | |
| 3 | @interface CallMeMaybe |
| 4 | |
| 5 | - (void)doThing:(int)intThing; |
| 6 | |
| 7 | @property int thing; |
| 8 | |
| 9 | @end |
| 10 | |
| 11 | template<typename T> |
| 12 | void instantiate(const T &x) { |
| 13 | [x setThing: 22]; // expected-warning {{messaging unqualified id}} |
| 14 | } |
| 15 | |
| 16 | void fn() { |
| 17 | id myObject; |
| 18 | [myObject doThing: 10]; // expected-warning {{messaging unqualified id}} |
| 19 | [myObject setThing: 11]; // expected-warning {{messaging unqualified id}} |
| 20 | instantiate(myObject); // expected-note {{in instantiation}} |
| 21 | } |