]> granicus.if.org Git - clang/commitdiff
Have ObjCMethodDecl::getCanonicalDecl take into account redeclared methods.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 17 Oct 2011 19:48:09 +0000 (19:48 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 17 Oct 2011 19:48:09 +0000 (19:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142231 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclObjC.cpp

index 5af3cf599061f84ccd14c05f18ae3e756b20afd0..0481f9cdf5d395c6ac49bdbe3be13b5ac4e45c69 100644 (file)
@@ -452,6 +452,10 @@ ObjCMethodDecl *ObjCMethodDecl::getCanonicalDecl() {
         return MD;
   }
 
+  if (isRedeclaration())
+    return cast<ObjCContainerDecl>(CtxD)->getMethod(getSelector(),
+                                                    isInstanceMethod());
+
   return this;
 }