summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-28 18:14:24 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-09-28 18:14:24 +0000
commitfcc1e50ebcb441c6c610ccd539f57c57549bd66c (patch)
tree65f3c8b004987dc680b9e361455181e84fd92027
parentde5db649fd5f9aedde200f443ad73d62517b1c88 (diff)
Introduce non-const Decl::getParentFunctionOrMethod.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140707 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/DeclBase.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index 2a2f810044..7e093c8ceb 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -574,6 +574,10 @@ public:
/// \brief If this decl is defined inside a function/method/block it returns
/// the corresponding DeclContext, otherwise it returns null.
const DeclContext *getParentFunctionOrMethod() const;
+ DeclContext *getParentFunctionOrMethod() {
+ return const_cast<DeclContext*>(
+ const_cast<const Decl*>(this)->getParentFunctionOrMethod());
+ }
/// \brief Retrieves the "canonical" declaration of the given declaration.
virtual Decl *getCanonicalDecl() { return this; }