]> granicus.if.org Git - clang/commitdiff
Don't assert that we have a valid access specifier on an invalid
authorDouglas Gregor <dgregor@apple.com>
Mon, 22 Feb 2010 17:53:38 +0000 (17:53 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 22 Feb 2010 17:53:38 +0000 (17:53 +0000)
declaration. This is the trivial part of PR6365.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96792 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclBase.cpp

index 222adcb28e4ee5139dd9f2498800e92522f440e2..47b7e7efb60e06dc12fc46705bff9d4e6aca0cbb 100644 (file)
@@ -436,7 +436,8 @@ void Decl::CheckAccessDeclContext() const {
   //    FunctionDecl)
   // 4. the context is not a record
   if (isa<TranslationUnitDecl>(this) ||
-      !isa<CXXRecordDecl>(getDeclContext()))
+      !isa<CXXRecordDecl>(getDeclContext()) ||
+      isInvalidDecl())
     return;
 
   assert(Access != AS_none &&