mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-10 06:56:08 +00:00

This is especially important for Objective-C++, which is entirely missing this testing at the moment. This annotates with "FIXME" the cases which I change in the next patch -- I primarily wanted to document the current state of things so that the effect of the code change is made clear. Differential Revision: https://reviews.llvm.org/D67982 llvm-svn: 375124
25 lines
540 B
Objective-C
25 lines
540 B
Objective-C
// RUN: %clang_cc1 -verify -Wno-objc-root-class %s
|
|
|
|
@interface XX
|
|
|
|
- (void)addObserver:(XX*)o; // expected-note 2{{passing argument to parameter 'o' here}}
|
|
|
|
@end
|
|
|
|
@interface YY
|
|
|
|
+ (void)classMethod;
|
|
|
|
@end
|
|
|
|
@implementation YY
|
|
|
|
static XX *obj;
|
|
|
|
+ (void)classMethod {
|
|
[obj addObserver:self]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}}
|
|
Class whatever;
|
|
[obj addObserver:whatever]; // expected-warning {{incompatible pointer types sending 'Class' to parameter of type 'XX *'}}
|
|
}
|
|
@end
|