From: Argyrios Kyrtzidis Date: Tue, 30 Jun 2009 02:35:38 +0000 (+0000) Subject: Introduce DeclContext::getParentASTContext(). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=048f30a483ca352ee7f235a5be181b9dcc5f9d9c;p=clang 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 --- 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: