From: Anna Zaks Date: Sat, 19 May 2012 00:22:11 +0000 (+0000) Subject: [analyzer] c++11: do not crash on namespace alias X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=671e3bc1a16562902c0e6efc157b519977c299a8;p=clang [analyzer] c++11: do not crash on namespace alias git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157089 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h b/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h index 97eb287027..c510e202f9 100644 --- a/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h +++ b/include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h @@ -69,6 +69,7 @@ public: DISPATCH_CASE(Field) DISPATCH_CASE(UsingDirective) DISPATCH_CASE(Using) + DISPATCH_CASE(NamespaceAlias) default: llvm_unreachable("Subtype of ScopedDecl not handled."); } @@ -90,6 +91,7 @@ public: DEFAULT_DISPATCH(ObjCCategory) DEFAULT_DISPATCH(UsingDirective) DEFAULT_DISPATCH(Using) + DEFAULT_DISPATCH(NamespaceAlias) void VisitCXXRecordDecl(CXXRecordDecl *D) { static_cast(this)->VisitRecordDecl(D); diff --git a/test/Analysis/cxx11-crashes.cpp b/test/Analysis/cxx11-crashes.cpp index 9164850555..6e60ac63cc 100644 --- a/test/Analysis/cxx11-crashes.cpp +++ b/test/Analysis/cxx11-crashes.cpp @@ -10,3 +10,24 @@ PlotPoint limitedFit () { fit0 = limitedFit (); return fit0; } + +// radar://11487541, NamespaceAlias +namespace boost {namespace filesystem3 { +class path { +public: + path(){} +}; + +}} +namespace boost +{ + namespace filesystem + { + using filesystem3::path; + } +} + +void radar11487541() { + namespace fs = boost::filesystem; + fs::path p; +}