Index: include/clang/AST/Decl.h
===================================================================
--- include/clang/AST/Decl.h	(revision 193745)
+++ include/clang/AST/Decl.h	(working copy)
@@ -274,7 +274,7 @@
   }
 
   NamedDecl *getMostRecentDecl() {
-    return cast<NamedDecl>(Decl::getMostRecentDecl());
+    return cast<NamedDecl>(static_cast<Decl *>(this)->getMostRecentDecl());
   }
   const NamedDecl *getMostRecentDecl() const {
     return const_cast<NamedDecl*>(this)->getMostRecentDecl();
@@ -2821,7 +2821,8 @@
   }
 
   EnumDecl *getPreviousDecl() {
-    return cast_or_null<EnumDecl>(TagDecl::getPreviousDecl());
+    return cast_or_null<EnumDecl>(
+            static_cast<TagDecl *>(this)->getPreviousDecl());
   }
   const EnumDecl *getPreviousDecl() const {
     return const_cast<EnumDecl*>(this)->getPreviousDecl();
@@ -2828,7 +2829,7 @@
   }
 
   EnumDecl *getMostRecentDecl() {
-    return cast<EnumDecl>(TagDecl::getMostRecentDecl());
+    return cast<EnumDecl>(static_cast<TagDecl *>(this)->getMostRecentDecl());
   }
   const EnumDecl *getMostRecentDecl() const {
     return const_cast<EnumDecl*>(this)->getMostRecentDecl();
@@ -3028,7 +3029,8 @@
   static RecordDecl *CreateDeserialized(const ASTContext &C, unsigned ID);
 
   RecordDecl *getPreviousDecl() {
-    return cast_or_null<RecordDecl>(TagDecl::getPreviousDecl());
+    return cast_or_null<RecordDecl>(
+            static_cast<TagDecl *>(this)->getPreviousDecl());
   }
   const RecordDecl *getPreviousDecl() const {
     return const_cast<RecordDecl*>(this)->getPreviousDecl();
@@ -3035,7 +3037,7 @@
   }
 
   RecordDecl *getMostRecentDecl() {
-    return cast<RecordDecl>(TagDecl::getMostRecentDecl());
+    return cast<RecordDecl>(static_cast<TagDecl *>(this)->getMostRecentDecl());
   }
   const RecordDecl *getMostRecentDecl() const {
     return const_cast<RecordDecl*>(this)->getMostRecentDecl();
Index: include/clang/AST/DeclCXX.h
===================================================================
--- include/clang/AST/DeclCXX.h	(revision 193745)
+++ include/clang/AST/DeclCXX.h	(working copy)
@@ -647,7 +647,8 @@
   }
 
   CXXRecordDecl *getPreviousDecl() {
-    return cast_or_null<CXXRecordDecl>(RecordDecl::getPreviousDecl());
+    return cast_or_null<CXXRecordDecl>(
+            static_cast<RecordDecl *>(this)->getPreviousDecl());
   }
   const CXXRecordDecl *getPreviousDecl() const {
     return const_cast<CXXRecordDecl*>(this)->getPreviousDecl();
@@ -654,7 +655,8 @@
   }
 
   CXXRecordDecl *getMostRecentDecl() {
-    return cast<CXXRecordDecl>(RecordDecl::getMostRecentDecl());
+    return cast<CXXRecordDecl>(
+            static_cast<RecordDecl *>(this)->getMostRecentDecl());
   }
 
   const CXXRecordDecl *getMostRecentDecl() const {
@@ -1725,7 +1727,8 @@
   }
 
   CXXMethodDecl *getMostRecentDecl() {
-    return cast<CXXMethodDecl>(FunctionDecl::getMostRecentDecl());
+    return cast<CXXMethodDecl>(
+            static_cast<FunctionDecl *>(this)->getMostRecentDecl());
   }
   const CXXMethodDecl *getMostRecentDecl() const {
     return const_cast<CXXMethodDecl*>(this)->getMostRecentDecl();
Index: include/clang/AST/DeclTemplate.h
===================================================================
--- include/clang/AST/DeclTemplate.h	(revision 193745)
+++ include/clang/AST/DeclTemplate.h	(working copy)
@@ -826,7 +826,7 @@
   /// NULL if no such declaration exists.
   FunctionTemplateDecl *getPreviousDecl() {
     return cast_or_null<FunctionTemplateDecl>(
-             RedeclarableTemplateDecl::getPreviousDecl());
+             static_cast<RedeclarableTemplateDecl *>(this)->getPreviousDecl());
   }
 
   /// \brief Retrieve the previous declaration of this function template, or
@@ -833,7 +833,7 @@
   /// NULL if no such declaration exists.
   const FunctionTemplateDecl *getPreviousDecl() const {
     return cast_or_null<FunctionTemplateDecl>(
-             RedeclarableTemplateDecl::getPreviousDecl());
+       static_cast<const RedeclarableTemplateDecl *>(this)->getPreviousDecl());
   }
 
   FunctionTemplateDecl *getInstantiatedFromMemberTemplate() {
@@ -1449,7 +1449,8 @@
                                     bool Qualified) const;
 
   ClassTemplateSpecializationDecl *getMostRecentDecl() {
-    CXXRecordDecl *Recent = CXXRecordDecl::getMostRecentDecl();
+    CXXRecordDecl *Recent = static_cast<CXXRecordDecl *>(
+                              this)->getMostRecentDecl();
     while (!isa<ClassTemplateSpecializationDecl>(Recent)) {
       // FIXME: Does injected class name need to be in the redeclarations chain?
       assert(Recent->isInjectedClassName() && Recent->getPreviousDecl());
@@ -1691,7 +1692,8 @@
 
   ClassTemplatePartialSpecializationDecl *getMostRecentDecl() {
     return cast<ClassTemplatePartialSpecializationDecl>(
-                   ClassTemplateSpecializationDecl::getMostRecentDecl());
+             static_cast<ClassTemplateSpecializationDecl *>(
+               this)->getMostRecentDecl());
   }
 
   /// Get the list of template parameters
@@ -1890,7 +1892,7 @@
   /// NULL if no such declaration exists.
   ClassTemplateDecl *getPreviousDecl() {
     return cast_or_null<ClassTemplateDecl>(
-             RedeclarableTemplateDecl::getPreviousDecl());
+             static_cast<RedeclarableTemplateDecl *>(this)->getPreviousDecl());
   }
 
   /// \brief Retrieve the previous declaration of this class template, or
@@ -1897,12 +1899,13 @@
   /// NULL if no such declaration exists.
   const ClassTemplateDecl *getPreviousDecl() const {
     return cast_or_null<ClassTemplateDecl>(
-             RedeclarableTemplateDecl::getPreviousDecl());
+             static_cast<const RedeclarableTemplateDecl *>(
+               this)->getPreviousDecl());
   }
 
   ClassTemplateDecl *getMostRecentDecl() {
     return cast<ClassTemplateDecl>(
-        RedeclarableTemplateDecl::getMostRecentDecl());
+        static_cast<RedeclarableTemplateDecl *>(this)->getMostRecentDecl());
   }
   const ClassTemplateDecl *getMostRecentDecl() const {
     return const_cast<ClassTemplateDecl*>(this)->getMostRecentDecl();
@@ -2132,7 +2135,7 @@
   /// NULL if no such declaration exists.
   TypeAliasTemplateDecl *getPreviousDecl() {
     return cast_or_null<TypeAliasTemplateDecl>(
-             RedeclarableTemplateDecl::getPreviousDecl());
+             static_cast<RedeclarableTemplateDecl *>(this)->getPreviousDecl());
   }
 
   /// \brief Retrieve the previous declaration of this function template, or
@@ -2139,7 +2142,8 @@
   /// NULL if no such declaration exists.
   const TypeAliasTemplateDecl *getPreviousDecl() const {
     return cast_or_null<TypeAliasTemplateDecl>(
-             RedeclarableTemplateDecl::getPreviousDecl());
+             static_cast<const RedeclarableTemplateDecl *>(
+               this)->getPreviousDecl());
   }
 
   TypeAliasTemplateDecl *getInstantiatedFromMemberTemplate() {
@@ -2317,7 +2321,7 @@
                                     bool Qualified) const;
 
   VarTemplateSpecializationDecl *getMostRecentDecl() {
-    VarDecl *Recent = VarDecl::getMostRecentDecl();
+    VarDecl *Recent = static_cast<VarDecl *>(this)->getMostRecentDecl();
     return cast<VarTemplateSpecializationDecl>(Recent);
   }
 
@@ -2547,7 +2551,8 @@
 
   VarTemplatePartialSpecializationDecl *getMostRecentDecl() {
     return cast<VarTemplatePartialSpecializationDecl>(
-        VarTemplateSpecializationDecl::getMostRecentDecl());
+             static_cast<VarTemplateSpecializationDecl *>(
+               this)->getMostRecentDecl());
   }
 
   /// Get the list of template parameters
@@ -2730,7 +2735,7 @@
   /// NULL if no such declaration exists.
   VarTemplateDecl *getPreviousDecl() {
     return cast_or_null<VarTemplateDecl>(
-        RedeclarableTemplateDecl::getPreviousDecl());
+        static_cast<RedeclarableTemplateDecl *>(this)->getPreviousDecl());
   }
 
   /// \brief Retrieve the previous declaration of this variable template, or
@@ -2737,7 +2742,8 @@
   /// NULL if no such declaration exists.
   const VarTemplateDecl *getPreviousDecl() const {
     return cast_or_null<VarTemplateDecl>(
-        RedeclarableTemplateDecl::getPreviousDecl());
+            static_cast<const RedeclarableTemplateDecl *>(
+              this)->getPreviousDecl());
   }
 
   VarTemplateDecl *getInstantiatedFromMemberTemplate() {
