summaryrefslogtreecommitdiffstats
path: root/clang/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
commita28908d575ed0180eddfd4fa7f25ac267a1f0ca3 (patch)
treeec85bed6941f2dfb006f6f845d37066c7d7185fa /clang/lib/AST/DeclBase.cpp
parentef1a09a3368c4ac421c00d14923cd31902ba9dfb (diff)
downloadbcm5719-llvm-a28908d575ed0180eddfd4fa7f25ac267a1f0ca3.tar.gz
bcm5719-llvm-a28908d575ed0180eddfd4fa7f25ac267a1f0ca3.zip
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. llvm-svn: 67717
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 812c362acd3..cb126184435 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/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
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud