aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-06-30 02:35:38 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2009-06-30 02:35:38 +0000
commit048f30a483ca352ee7f235a5be181b9dcc5f9d9c (patch)
tree45b98681558c16a2a11662634a3b3286cebc8a9f
parent6fb0aee4f9dc261bbec72e1283ad8dc0557a6d96 (diff)
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
-rw-r--r--include/clang/AST/DeclBase.h6
1 files changed, 5 insertions, 1 deletions
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<DeclContext*>(this)->getLexicalParent();
}
-
+
+ ASTContext &getParentASTContext() const {
+ return cast<Decl>(this)->getASTContext();
+ }
+
bool isFunctionOrMethod() const {
switch (DeclKind) {
case Decl::Block: