summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclObjC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r--clang/lib/AST/DeclObjC.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp
index 170cdf43fc4..a589b7f9d3e 100644
--- a/clang/lib/AST/DeclObjC.cpp
+++ b/clang/lib/AST/DeclObjC.cpp
@@ -355,6 +355,7 @@ void ObjCMethodDecl::setAsRedeclaration(const ObjCMethodDecl *PrevMethod) {
assert(PrevMethod);
getASTContext().setObjCMethodRedeclaration(PrevMethod, this);
IsRedeclaration = true;
+ PrevMethod->HasRedeclaration = true;
}
void ObjCMethodDecl::setParamsAndSelLocs(ASTContext &C,
@@ -398,8 +399,9 @@ void ObjCMethodDecl::setMethodParams(ASTContext &C,
/// Otherwise it will return itself.
ObjCMethodDecl *ObjCMethodDecl::getNextRedeclaration() {
ASTContext &Ctx = getASTContext();
- ObjCMethodDecl *Redecl =
- const_cast<ObjCMethodDecl*>(Ctx.getObjCMethodRedeclaration(this));
+ ObjCMethodDecl *Redecl = 0;
+ if (HasRedeclaration)
+ Redecl = const_cast<ObjCMethodDecl*>(Ctx.getObjCMethodRedeclaration(this));
if (Redecl)
return Redecl;
OpenPOWER on IntegriCloud