aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/DeclBase.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-01-20 21:53:11 +0000
committerJohn McCall <rjmccall@apple.com>2010-01-20 21:53:11 +0000
commit46460a68f6508775e98c19b4bb8454bb471aac24 (patch)
treed1149be909b4f69e69a2d06d67538462ba88282e /lib/AST/DeclBase.cpp
parent78205d4bada39d95097e766af9eb30cdd0159461 (diff)
First pass at collecting access-specifier information along inheritance paths.
Triggers lots of assertions about missing access information; fix them. Will actually consume this information soon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94038 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclBase.cpp')
-rw-r--r--lib/AST/DeclBase.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/AST/DeclBase.cpp b/lib/AST/DeclBase.cpp
index 76ff83448a..95b749bfbb 100644
--- a/lib/AST/DeclBase.cpp
+++ b/lib/AST/DeclBase.cpp
@@ -410,9 +410,16 @@ SourceLocation Decl::getBodyRBrace() const {
#ifndef NDEBUG
void Decl::CheckAccessDeclContext() const {
- // If the decl is the toplevel translation unit or if we're not in a
- // record decl context, we don't need to check anything.
+ // 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. this is a ParmVarDecl (which can be in a record context during
+ // the brief period between its creation and the creation of the
+ // FunctionDecl)
+ // 4. the context is not a record
if (isa<TranslationUnitDecl>(this) ||
+ isTemplateParameter() ||
+ isa<ParmVarDecl>(this) ||
!isa<CXXRecordDecl>(getDeclContext()))
return;