]> granicus.if.org Git - clang/commitdiff
Allow us to ask for the access specifier of a translation unit
authorDouglas Gregor <dgregor@apple.com>
Tue, 7 Apr 2009 20:58:25 +0000 (20:58 +0000)
committerDouglas Gregor <dgregor@apple.com>
Tue, 7 Apr 2009 20:58:25 +0000 (20:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68548 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclBase.cpp

index 615bf00087b4dc82c6cc1281dd97fa94787435ca..f098496f23dbb17f5e2f991caf3d21a1564508ba 100644 (file)
@@ -338,7 +338,8 @@ DeclContext *Decl::castToDeclContext(const Decl *D) {
 
 #ifndef NDEBUG
 void Decl::CheckAccessDeclContext() const {
-  assert((Access != AS_none || !isa<CXXRecordDecl>(getDeclContext())) &&
+  assert((Access != AS_none || isa<TranslationUnitDecl>(this) ||
+          !isa<CXXRecordDecl>(getDeclContext())) &&
          "Access specifier is AS_none inside a record decl");
 }