summaryrefslogtreecommitdiffstats
path: root/clang/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
commit401982f56c3633a4c77ddad49708795132265e13 (patch)
tree5aeb4c593a7e4f11c2221c1931d238c058c73e2e /clang/lib/AST/DeclBase.cpp
parentdd969c897ecb31480f3cee2856ff72e0854d8527 (diff)
downloadbcm5719-llvm-401982f56c3633a4c77ddad49708795132265e13.tar.gz
bcm5719-llvm-401982f56c3633a4c77ddad49708795132265e13.zip
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. llvm-svn: 94038
Diffstat (limited to 'clang/lib/AST/DeclBase.cpp')
-rw-r--r--clang/lib/AST/DeclBase.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 76ff83448a0..95b749bfbbd 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/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;
OpenPOWER on IntegriCloud