aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-09-08 21:58:42 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-09-08 21:58:42 +0000
commitd580e5636568cdc8db0584dd3b7a53323f981e48 (patch)
tree2d8700d80ae298d0b4ae5d8c2c97052c420debe9 /lib/AST/DeclBase.cpp
parent4c03398289c083fc4811119b1ed196138eca35c3 (diff)
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
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp13
1 files changed, 9 insertions, 4 deletions
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<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 &&