From: Alex Lorenz Date: Tue, 3 Jan 2017 12:12:36 +0000 (+0000) Subject: Handle AccessSpecDecl in DeclContextPrinter X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44df50df1f5458b0d1b59d5e0654986d0d5720d8;p=clang Handle AccessSpecDecl in DeclContextPrinter This commit fixes a crash that occurs when -print-decl-contexts AST consumer tries to print an unhandled declaration. rdar://19467234 Differential Revision: https://reviews.llvm.org/D26964 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290885 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Frontend/ASTConsumers.cpp b/lib/Frontend/ASTConsumers.cpp index f5cca139bc..c45b539a56 100644 --- a/lib/Frontend/ASTConsumers.cpp +++ b/lib/Frontend/ASTConsumers.cpp @@ -518,6 +518,10 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC, Out << "\n"; break; } + case Decl::AccessSpec: { + Out << "\n"; + break; + } default: Out << "DeclKind: " << DK << '"' << I << "\"\n"; llvm_unreachable("decl unhandled"); diff --git a/test/Coverage/cxx-language-features.inc b/test/Coverage/cxx-language-features.inc index 1df4db7d35..be99eece79 100644 --- a/test/Coverage/cxx-language-features.inc +++ b/test/Coverage/cxx-language-features.inc @@ -55,3 +55,8 @@ template struct ClassTemplatePartialSpecialization; template struct ClassTemplatePartialSpecialization { }; + +// Access specifier +struct AccessSpec { +private: +};