[cfe-commits] r125491 - in /cfe/trunk: include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h test/Analysis/misc-ps-region-store.cpp

Ted Kremenek kremenek at apple.com
Mon Feb 14 09:00:16 PST 2011


Author: kremenek
Date: Mon Feb 14 11:00:16 2011
New Revision: 125491

URL: http://llvm.org/viewvc/llvm-project?rev=125491&view=rev
Log:
Handle 'UsingDirective' in CFGRecStmtDeclVisitor.

Modified:
    cfe/trunk/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h
    cfe/trunk/test/Analysis/misc-ps-region-store.cpp

Modified: cfe/trunk/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h?rev=125491&r1=125490&r2=125491&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h (original)
+++ cfe/trunk/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h Mon Feb 14 11:00:16 2011
@@ -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);

Modified: cfe/trunk/test/Analysis/misc-ps-region-store.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/misc-ps-region-store.cpp?rev=125491&r1=125490&r2=125491&view=diff
==============================================================================
--- cfe/trunk/test/Analysis/misc-ps-region-store.cpp (original)
+++ cfe/trunk/test/Analysis/misc-ps-region-store.cpp Mon Feb 14 11:00:16 2011
@@ -225,3 +225,18 @@
   Baz();
   value_();
 }
+
+//===---------------------------------------------------------------------===//
+// Handle misc. C++ constructs.
+//===---------------------------------------------------------------------===//
+
+namespace fum {
+  int i = 3;
+};
+
+void test_namespace() {
+  // Previously triggered a crash.
+  using namespace fum;
+  int x = i;
+}
+





More information about the cfe-commits mailing list