forked from OSchip/llvm-project
More tests for Objective-C-related name lookup weirdness. Yes, it's
weird; yes, it's what GCC does. Almost. llvm-svn: 101803
This commit is contained in:
parent
c334960f16
commit
26380d493b
|
@ -16,3 +16,22 @@ extern struct foo x;
|
|||
}
|
||||
|
||||
@end
|
||||
|
||||
@interface Ivar
|
||||
- (float*)method;
|
||||
@end
|
||||
|
||||
@interface A {
|
||||
A *Ivar;
|
||||
}
|
||||
- (int*)method;
|
||||
@end
|
||||
|
||||
@implementation A
|
||||
- (int*)method {
|
||||
int *ip = [Ivar method]; // expected-warning{{warning: incompatible pointer types initializing 'int *' with an expression of type 'float *'}}
|
||||
// Note that there is no warning in Objective-C++
|
||||
return 0;
|
||||
}
|
||||
@end
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
@interface Ivar
|
||||
- (float*)method;
|
||||
@end
|
||||
|
||||
@interface A {
|
||||
A *Ivar;
|
||||
}
|
||||
- (int*)method;
|
||||
@end
|
||||
|
||||
@implementation A
|
||||
- (int*)method {
|
||||
int *ip = [Ivar method]; // Okay; calls A's method on the instance variable Ivar.
|
||||
// Note that Objective-C calls Ivar's method.
|
||||
return 0;
|
||||
}
|
||||
@end
|
Loading…
Reference in New Issue