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
This commit is contained in:
Alex Lorenz 2017-01-03 12:12:36 +00:00
parent eebc494a57
commit 21c3293b42
2 changed files with 9 additions and 0 deletions

View File

@ -518,6 +518,10 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
Out << "<empty>\n";
break;
}
case Decl::AccessSpec: {
Out << "<access specifier>\n";
break;
}
default:
Out << "DeclKind: " << DK << '"' << I << "\"\n";
llvm_unreachable("decl unhandled");

View File

@ -55,3 +55,8 @@ template<typename T, bool> struct ClassTemplatePartialSpecialization;
template<typename T>
struct ClassTemplatePartialSpecialization<T, true> { };
// Access specifier
struct AccessSpec {
private:
};