diff options
author | Anna Zaks <ganna@apple.com> | 2012-05-19 00:22:11 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-05-19 00:22:11 +0000 |
commit | 671e3bc1a16562902c0e6efc157b519977c299a8 (patch) | |
tree | 39d15c955ff496fcfc9d4ad1b42c817ead46d90c | |
parent | 591b5f53c0e11d87401b4804bb1be1a53f95c619 (diff) |
[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
-rw-r--r-- | include/clang/Analysis/Visitors/CFGRecStmtDeclVisitor.h | 2 | ||||
-rw-r--r-- | test/Analysis/cxx11-crashes.cpp | 21 |
2 files changed, 23 insertions, 0 deletions
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<ImplClass*>(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; +} |