From 21c3293b42862390ece7ec1b41aa18e061910912 Mon Sep 17 00:00:00 2001 From: Alex Lorenz Date: Tue, 3 Jan 2017 12:12:36 +0000 Subject: [PATCH] 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 llvm-svn: 290885 --- clang/lib/Frontend/ASTConsumers.cpp | 4 ++++ clang/test/Coverage/cxx-language-features.inc | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/clang/lib/Frontend/ASTConsumers.cpp b/clang/lib/Frontend/ASTConsumers.cpp index f5cca139bca1..c45b539a5698 100644 --- a/clang/lib/Frontend/ASTConsumers.cpp +++ b/clang/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/clang/test/Coverage/cxx-language-features.inc b/clang/test/Coverage/cxx-language-features.inc index 1df4db7d35d2..be99eece7978 100644 --- a/clang/test/Coverage/cxx-language-features.inc +++ b/clang/test/Coverage/cxx-language-features.inc @@ -55,3 +55,8 @@ template struct ClassTemplatePartialSpecialization; template struct ClassTemplatePartialSpecialization { }; + +// Access specifier +struct AccessSpec { +private: +};