[cfe-commits] r113419 - /cfe/trunk/lib/AST/DeclBase.cpp

Argyrios Kyrtzidis akyrtzi at gmail.com
Wed Sep 8 14:58:42 PDT 2010


Author: akirtzidis
Date: Wed Sep  8 16:58:42 2010
New Revision: 113419

URL: http://llvm.org/viewvc/llvm-project?rev=113419&view=rev
Log:
Decl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases.

Modified:
    cfe/trunk/lib/AST/DeclBase.cpp

Modified: cfe/trunk/lib/AST/DeclBase.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclBase.cpp?rev=113419&r1=113418&r2=113419&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclBase.cpp (original)
+++ cfe/trunk/lib/AST/DeclBase.cpp Wed Sep  8 16:58:42 2010
@@ -421,17 +421,22 @@
   // 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 &&





More information about the cfe-commits mailing list