summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@apple.com>2017-10-12 23:24:38 +0000
committerAkira Hatanaka <ahatanaka@apple.com>2017-10-12 23:24:38 +0000
commit73cab88c496ce16201535578c3febefc4172f271 (patch)
tree26d51f512546a9ac98dbcf61316139887302c18b /clang/lib/Sema/SemaDeclObjC.cpp
parent883f22ef7e5ba3848558306ab039f76be46b4005 (diff)
downloadbcm5719-llvm-73cab88c496ce16201535578c3febefc4172f271.tar.gz
bcm5719-llvm-73cab88c496ce16201535578c3febefc4172f271.zip
[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
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 5ab9d80c00b..104b2dfc996 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -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.
OpenPOWER on IntegriCloud