[clang-tools-extra] b144cd8 - Dump decl when the test matcher fails.

Haojian Wu via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 12 06:42:38 PDT 2020


Author: Haojian Wu
Date: 2020-10-12T15:42:18+02:00
New Revision: b144cd867b6fdfbf0e80064cb67d06c267fa295c

URL: https://github.com/llvm/llvm-project/commit/b144cd867b6fdfbf0e80064cb67d06c267fa295c
DIFF: https://github.com/llvm/llvm-project/commit/b144cd867b6fdfbf0e80064cb67d06c267fa295c.diff

LOG: Dump decl when the test matcher fails.

Added: 
    

Modified: 
    clang-tools-extra/clangd/unittests/ParsedASTTests.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp b/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
index e2de95909fbf..5b26773d95db 100644
--- a/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ParsedASTTests.cpp
@@ -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);


        


More information about the cfe-commits mailing list