aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-03-25 23:38:06 +0000
committerAnders Carlsson <andersca@mac.com>2009-03-25 23:38:06 +0000
commit1329c274628cc8c4e8ad472b41d1a78c8123f611 (patch)
tree3bb7d7ab81697205ca638a0c5d9c4e233ababc20 /lib/AST/DeclBase.cpp
parent3d7a12a50558c31d4351e923c15ab57688f4fdf2 (diff)
Tighten the setAccess assert. We now allow AS_none if the decl contex is not a C++ record decl.
Also, fix fallout from the change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67717 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp8
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
//===----------------------------------------------------------------------===//