The following code, when compiled with 'clang -cc1 -analyze -analyzer-check-objc-mem -cfg-dump' will generate a 'Subtype of ScopeDecl not handled error', I'm not sure where a test case should go for this?

namespace fum {
  int i = 3;
};

void foo() {
  using namespace fum;

  int x = i;
}

Patch:

Index: include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h
===================================================================
--- include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h     (revision 
125488)
+++ include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h     (working copy)
@@ -66,6 +66,7 @@
         DISPATCH_CASE(Record)    // FIXME: Refine.  VisitStructDecl?
         DISPATCH_CASE(CXXRecord)
         DISPATCH_CASE(Enum)
+        DISPATCH_CASE(UsingDirective)
       default:
         assert(false && "Subtype of ScopedDecl not handled.");
     }
@@ -85,6 +86,7 @@
   DEFAULT_DISPATCH(ObjCMethod)
   DEFAULT_DISPATCH(ObjCProtocol)
   DEFAULT_DISPATCH(ObjCCategory)
+  DEFAULT_DISPATCH(UsingDirective)

   void VisitCXXRecordDecl(CXXRecordDecl *D) {
     static_cast<ImplClass*>(this)->VisitRecordDecl(D);

Attachment: using.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to