Simplify some implementations of get*Decl.
* NamedDecl and CXXMethodDecl were missing getMostRecentDecl.
* The const version can just forward to the non const.
* getMostRecentDecl can use cast instead of cast_or_null.
This then removes some casts from the callers.
llvm-svn: 193039
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 2b48de4..d7c4f78 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4487,7 +4487,7 @@
}
NamedDecl *D = LocallyScopedExternCDecls.lookup(Name);
- return D ? cast<NamedDecl>(D->getMostRecentDecl()) : 0;
+ return D ? D->getMostRecentDecl() : 0;
}
/// \brief Diagnose function specifiers on a declaration of an identifier that