diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-28 18:14:24 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-09-28 18:14:24 +0000 |
commit | fcc1e50ebcb441c6c610ccd539f57c57549bd66c (patch) | |
tree | 65f3c8b004987dc680b9e361455181e84fd92027 | |
parent | de5db649fd5f9aedde200f443ad73d62517b1c88 (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.h | 4 |
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; } |