summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-09-08 21:32:35 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-09-08 21:32:35 +0000
commit260b4a8e929adc4d8e89c315c47f5032805486ad (patch)
tree4a0b14cb1134bc18c7e623cefe05c7fc420a470b /clang/lib
parent73f59c433d280e4b6fbf7377eef051a355a566f2 (diff)
downloadbcm5719-llvm-260b4a8e929adc4d8e89c315c47f5032805486ad.tar.gz
bcm5719-llvm-260b4a8e929adc4d8e89c315c47f5032805486ad.zip
Re-enable CheckAccessDeclContext and make sure it doesn't trigger assertions.
llvm-svn: 113413
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/DeclBase.cpp10
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp3
2 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/AST/DeclBase.cpp b/clang/lib/AST/DeclBase.cpp
index 0b958fe82b0..7525b34d884 100644
--- a/clang/lib/AST/DeclBase.cpp
+++ b/clang/lib/AST/DeclBase.cpp
@@ -418,18 +418,20 @@ SourceLocation Decl::getBodyRBrace() const {
#ifndef NDEBUG
void Decl::CheckAccessDeclContext() const {
- // FIXME: Disable this until rdar://8146294 "access specifier for inner class
- // templates is not set or checked" is fixed.
- return;
// 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.
if (isa<TranslationUnitDecl>(this) ||
isa<TemplateTypeParmDecl>(this) ||
!isa<CXXRecordDecl>(getDeclContext()) ||
- isInvalidDecl())
+ isInvalidDecl() ||
+ isa<StaticAssertDecl>(this) ||
+ // FIXME: a ParmVarDecl can have ClassTemplateSpecialization
+ // as DeclContext (?).
+ isa<ParmVarDecl>(this))
return;
assert(Access != AS_none &&
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index 653878209fc..995139830d4 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -1308,8 +1308,7 @@ Decl *ASTReader::ReadDeclRecord(unsigned Index, DeclID ID) {
D = CXXConversionDecl::Create(*Context, Decl::EmptyShell());
break;
case DECL_ACCESS_SPEC:
- D = AccessSpecDecl::Create(*Context, AS_none, 0, SourceLocation(),
- SourceLocation());
+ D = AccessSpecDecl::Create(*Context, Decl::EmptyShell());
break;
case DECL_FRIEND:
D = FriendDecl::Create(*Context, Decl::EmptyShell());
OpenPOWER on IntegriCloud