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:
Douglas Gregor 2010-04-19 19:10:40 +00:00
parent c334960f16
commit 26380d493b
2 changed files with 37 additions and 0 deletions

View File

@ -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

View File

@ -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