Handle StaticAssertDecl 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: 290887
This commit is contained in:
Alex Lorenz 2017-01-03 12:16:02 +00:00
parent a186417796
commit b44b4cbae8
2 changed files with 6 additions and 0 deletions

View File

@ -526,6 +526,10 @@ void DeclContextPrinter::PrintDeclContext(const DeclContext* DC,
Out << "<var template> " << *cast<VarTemplateDecl>(I) << "\n";
break;
}
case Decl::StaticAssert: {
Out << "<static assert>\n";
break;
}
default:
Out << "DeclKind: " << DK << '"' << I << "\"\n";
llvm_unreachable("decl unhandled");

View File

@ -63,3 +63,5 @@ private:
// Variable template
template <typename T> T varTemplate = 0;
static_assert(true, "");