diff options
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r-- | lib/AST/DeclBase.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 812c362acd..cb12618443 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -272,6 +272,14 @@ DeclContext *Decl::castToDeclContext(const Decl *D) { } } +#ifndef NDEBUG +void Decl::CheckAccessDeclContext() const { + assert((Access != AS_none || !isa<CXXRecordDecl>(getDeclContext())) && + "Access specifier is AS_none inside a record decl"); +} + +#endif + //===----------------------------------------------------------------------===// // DeclContext Implementation //===----------------------------------------------------------------------===// |