Dump decl when the test matcher fails.

This commit is contained in:
Haojian Wu 2020-10-12 15:41:04 +02:00
parent 28237c33d9
commit b144cd867b
1 changed files with 2 additions and 1 deletions

View File

@ -59,7 +59,8 @@ MATCHER_P(DeclNamed, Name, "") {
MATCHER_P(DeclKind, Kind, "") {
if (NamedDecl *ND = dyn_cast<NamedDecl>(arg))
return ND->getDeclKindName() == Kind;
if (ND->getDeclKindName() == Kind)
return true;
if (auto *Stream = result_listener->stream()) {
llvm::raw_os_ostream OS(*Stream);
arg->dump(OS);