From fcc1e50ebcb441c6c610ccd539f57c57549bd66c Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 28 Sep 2011 18:14:24 +0000 Subject: [PATCH] Introduce non-const Decl::getParentFunctionOrMethod. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140707 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DeclBase.h | 4 ++++ 1 file changed, 4 insertions(+) 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( + const_cast(this)->getParentFunctionOrMethod()); + } /// \brief Retrieves the "canonical" declaration of the given declaration. virtual Decl *getCanonicalDecl() { return this; } -- 2.50.1