[PATCH] D72066: [clangd] Assert that the testcases in LocateSymbol.All have no diagnostics

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 2 01:22:07 PST 2020


kadircet added a reviewer: kadircet.
kadircet added a comment.

thanks for taking a look at this!



================
Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:447
         struct X {
-          X& [[operator]]++() {}
+          X& [[operator]]++() { return *this; }
         };
----------------
nit: I would rather turn this into a declaration.


================
Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:532
 
+    // Disable warnings which some testcases intentionally trigger,
+    // so that we can assert the testcases have no diagnostics and
----------------
could we rather move these cases into a new test case?

in order to prevent accidental reliance on these flags when adding new tests.


================
Comment at: clang-tools-extra/clangd/unittests/XRefsTests.cpp:542
+    for (auto &Diag : AST.getDiagnostics()) {
+      llvm::errs() << Diag << "\n";
+    }
----------------
use `ADD_FAILURE` instead.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72066/new/

https://reviews.llvm.org/D72066





More information about the cfe-commits mailing list