aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/AST/Decl.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/AST/Decl.h b/include/clang/AST/Decl.h
index e0b0b169a2..673669209c 100644
--- a/include/clang/AST/Decl.h
+++ b/include/clang/AST/Decl.h
@@ -1146,7 +1146,12 @@ public:
return D->getKind() >= RecordFirst && D->getKind() <= RecordLast;
}
static bool classof(const RecordDecl *D) { return true; }
-
+ static DeclContext *castToDeclContext(const RecordDecl *D) {
+ return static_cast<DeclContext *>(const_cast<RecordDecl*>(D));
+ }
+ static RecordDecl *castFromDeclContext(const DeclContext *DC) {
+ return static_cast<RecordDecl *>(const_cast<DeclContext*>(DC));
+ }
protected:
/// EmitImpl - Serialize this RecordDecl. Called by Decl::Emit.
virtual void EmitImpl(llvm::Serializer& S) const;