]> granicus.if.org Git - clang/commitdiff
Don't assert that friend declarations must have access specifiers for now.
authorAnders Carlsson <andersca@mac.com>
Sat, 29 Aug 2009 01:13:02 +0000 (01:13 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 29 Aug 2009 01:13:02 +0000 (01:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80415 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclBase.cpp

index 3ced0eff4c52c8c5626518a6018112d443b344cb..5d30795abd710c3e52d197fab73ff25980f3066d 100644 (file)
@@ -379,8 +379,16 @@ SourceLocation Decl::getBodyRBrace() const {
 
 #ifndef NDEBUG
 void Decl::CheckAccessDeclContext() const {
-  assert((Access != AS_none || isa<TranslationUnitDecl>(this) ||
-          !isa<CXXRecordDecl>(getDeclContext())) &&
+  if (isa<TranslationUnitDecl>(this) ||
+      !isa<CXXRecordDecl>(getDeclContext()))
+    return;
+  
+  // FIXME: Should friend declarations have access specifiers?
+  if (isa<FriendDecl>(this) ||
+      getFriendObjectKind() != FOK_None)
+    return;
+  
+  assert(Access != AS_none &&
          "Access specifier is AS_none inside a record decl");
 }