[cfe-commits] [PATCH][Review Request]don't assert on 'using' within a function
Jim Goodnow II
jim at thegoodnows.net
Fri Dec 3 16:02:40 PST 2010
The following code:
void foo() {
using namespace std;
}
generates an Assert. This patch fixes that at least in terms of
default handling.
Index: include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h
===================================================================
--- include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h (revision 120636)
+++ 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);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: using.patch
Type: application/octet-stream
Size: 820 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20101203/08f8d670/attachment.obj>
More information about the cfe-commits
mailing list