[cfe-commits] [PATCH][Review Request]don't assert on 'using' within a function
Ted Kremenek
kremenek at apple.com
Fri Dec 3 16:08:59 PST 2010
Looks good to me.
Sent from my iPad
On Dec 3, 2010, at 4:02 PM, Jim Goodnow II <jim at thegoodnows.net> wrote:
> 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);
> <using.patch>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
More information about the cfe-commits
mailing list