aboutsummaryrefslogtreecommitdiff
path: root/include/clang/AST/DeclBase.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/AST/DeclBase.h')
-rw-r--r--include/clang/AST/DeclBase.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h
index ba948078a6..bfc7607b74 100644
--- a/include/clang/AST/DeclBase.h
+++ b/include/clang/AST/DeclBase.h
@@ -294,9 +294,10 @@ protected:
public:
/// getParent - Returns the containing DeclContext if this is a ScopedDecl,
/// else returns NULL.
- DeclContext *getParent();
- const DeclContext *getParent() const {
- return const_cast<DeclContext*>(this)->getParent();
+ const DeclContext *getParent() const;
+ DeclContext *getParent() {
+ return const_cast<DeclContext*>(
+ const_cast<const DeclContext*>(this)->getParent());
}
bool isFunctionOrMethod() const {