diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-08 21:58:42 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-08 21:58:42 +0000 |
commit | e177863afc574d16b075b80abff548d58a25aa69 (patch) | |
tree | 86e0de2702bad536198642a7838d8de1056c835d /clang/lib/AST/DeclBase.cpp | |
parent | d4ec16ca718b6202a3dae172257c623f0002b441 (diff) | |
download | bcm5719-llvm-e177863afc574d16b075b80abff548d58a25aa69.tar.gz bcm5719-llvm-e177863afc574d16b075b80abff548d58a25aa69.zip |
Decl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases.
llvm-svn: 113419
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r-- | clang/lib/AST/DeclBase.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp index 7525b34d884..f629722793b 100644 --- a/clang/lib/AST/DeclBase.cpp +++ b/clang/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<TranslationUnitDecl>(this) || isa<TemplateTypeParmDecl>(this) || + isa<NonTypeTemplateParmDecl>(this) || !isa<CXXRecordDecl>(getDeclContext()) || isInvalidDecl() || isa<StaticAssertDecl>(this) || // FIXME: a ParmVarDecl can have ClassTemplateSpecialization // as DeclContext (?). - isa<ParmVarDecl>(this)) + isa<ParmVarDecl>(this) || + // FIXME: a ClassTemplateSpecialization or CXXRecordDecl can have + // AS_none as access specifier. + isa<CXXRecordDecl>(this)) return; assert(Access != AS_none && |