forked from OSchip/llvm-project
[Sema][ObjC] Complete merging ObjC methods before checking their
overriding methods. This should fix test case Analysis/retain-release.m that was failing on the reverse iteration bot: http://lab.llvm.org:8011/builders/reverse-iteration The test used to fail because the loop in CheckObjCMethodOverrides would merge attribute ns_returns_retained on methods while checking whether the overriding methods were compatible. Since OverrideSearch::Overridden is a SmallPtrSet and the order in which the elements of the set are visited is non-deterministic, the test would fail when method 'clone' of the protocol 'F18P' was visited before F18(Cat)'s method 'clone' was visited. llvm-svn: 315639
This commit is contained in:
parent
883f22ef7e
commit
73cab88c49
|
@ -3580,8 +3580,6 @@ void Sema::mergeObjCMethodDecls(ObjCMethodDecl *newMethod,
|
|||
ni = newMethod->param_begin(), ne = newMethod->param_end();
|
||||
ni != ne && oi != oe; ++ni, ++oi)
|
||||
mergeParamDeclAttributes(*ni, *oi, *this);
|
||||
|
||||
CheckObjCMethodOverride(newMethod, oldMethod);
|
||||
}
|
||||
|
||||
static void diagnoseVarDeclTypeMismatch(Sema &S, VarDecl *New, VarDecl* Old) {
|
||||
|
|
|
@ -4223,6 +4223,10 @@ void Sema::CheckObjCMethodOverrides(ObjCMethodDecl *ObjCMethod,
|
|||
|
||||
// Then merge the declarations.
|
||||
mergeObjCMethodDecls(ObjCMethod, overridden);
|
||||
}
|
||||
|
||||
for (ObjCMethodDecl *overridden : overrides) {
|
||||
CheckObjCMethodOverride(ObjCMethod, overridden);
|
||||
|
||||
if (ObjCMethod->isImplicit() && overridden->isImplicit())
|
||||
continue; // Conflicting properties are detected elsewhere.
|
||||
|
|
Loading…
Reference in New Issue