From: Argyrios Kyrtzidis Date: Wed, 8 Sep 2010 21:58:42 +0000 (+0000) Subject: Decl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d580e5636568cdc8db0584dd3b7a53323f981e48;p=clang Decl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113419 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp index 7525b34d88..f629722793 100644 --- a/lib/AST/DeclBase.cpp +++ b/lib/AST/DeclBase.cpp @@ -421,17 +421,22 @@ void Decl::CheckAccessDeclContext() const { // Suppress this check if any of the following hold: // 1. this is the translation unit (and thus has no parent) // 2. this is a template parameter (and thus doesn't belong to its context) - // 3. the context is not a record - // 4. it's invalid - // 5. it's a C++0x static_assert. + // 3. this is a non-type template parameter + // 4. the context is not a record + // 5. it's invalid + // 6. it's a C++0x static_assert. if (isa(this) || isa(this) || + isa(this) || !isa(getDeclContext()) || isInvalidDecl() || isa(this) || // FIXME: a ParmVarDecl can have ClassTemplateSpecialization // as DeclContext (?). - isa(this)) + isa(this) || + // FIXME: a ClassTemplateSpecialization or CXXRecordDecl can have + // AS_none as access specifier. + isa(this)) return; assert(Access != AS_none &&