Retain all hidden methods in the global method pool, because they may become visible <rdar://problem/13172858>.
llvm-svn: 174648
This commit is contained in:
parent
0b62f8a632
commit
560b7fa0c4
|
@ -2045,6 +2045,10 @@ bool Sema::MatchTwoMethodDeclarations(const ObjCMethodDecl *left,
|
|||
left->getResultType(), right->getResultType()))
|
||||
return false;
|
||||
|
||||
// If either is hidden, it is not considered to match.
|
||||
if (left->isHidden() || right->isHidden())
|
||||
return false;
|
||||
|
||||
if (getLangOpts().ObjCAutoRefCount &&
|
||||
(left->hasAttr<NSReturnsRetainedAttr>()
|
||||
!= right->hasAttr<NSReturnsRetainedAttr>() ||
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
@interface A (Sub)
|
||||
- (char)method3;
|
||||
- (char*)method4;
|
||||
@end
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
@interface B (Sub)
|
||||
- (char *)method3;
|
||||
- (char*)method4;
|
||||
@end
|
||||
|
|
|
@ -116,6 +116,10 @@ module templates_right {
|
|||
module MethodPoolA {
|
||||
header "MethodPoolA.h"
|
||||
|
||||
explicit module Sub2 {
|
||||
header "MethodPoolASub2.h"
|
||||
}
|
||||
|
||||
explicit module Sub {
|
||||
header "MethodPoolASub.h"
|
||||
}
|
||||
|
|
|
@ -19,6 +19,10 @@ void testMethod2(id object) {
|
|||
[object method2:1];
|
||||
}
|
||||
|
||||
void testMethod4(id object) {
|
||||
[object method4]; // expected-warning{{instance method '-method4' not found (return type defaults to 'id')}}
|
||||
}
|
||||
|
||||
@import MethodPoolB;
|
||||
|
||||
void testMethod1Again(id object) {
|
||||
|
@ -46,3 +50,7 @@ void testMethod3AgainAgain(id object) {
|
|||
// expected-note@2{{using}}
|
||||
// expected-note@2{{also found}}
|
||||
}
|
||||
|
||||
void testMethod4Again(id object) {
|
||||
[object method4];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue