From 048f30a483ca352ee7f235a5be181b9dcc5f9d9c Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 30 Jun 2009 02:35:38 +0000 Subject: [PATCH] Introduce DeclContext::getParentASTContext(). It's not getASTContext() to avoid "getASTContext is ambiguous" compiler errors for subclasses of both Decl and DeclContext. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74505 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/DeclBase.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index 8ef02705f2..80322ff584 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -459,7 +459,11 @@ public: const DeclContext *getLexicalParent() const { return const_cast(this)->getLexicalParent(); } - + + ASTContext &getParentASTContext() const { + return cast(this)->getASTContext(); + } + bool isFunctionOrMethod() const { switch (DeclKind) { case Decl::Block: -- 2.50.1