[clang-tools-extra] [clang-doc] Add basic e2e test (PR #93928)

Paul Kirth via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 14 16:06:26 PDT 2024


================
@@ -299,8 +299,7 @@ Example usage for a project using a compile commands database:
   llvm::outs() << "Generating assets for docs...\n";
   Err = G->get()->createResources(CDCtx);
   if (Err) {
-    llvm::errs() << toString(std::move(Err)) << "\n";
-    return 1;
+    llvm::outs() << "Warning: " << toString(std::move(Err)) << "\n";
----------------
ilovepi wrote:

@petrhosek do you know if there's a better way to emit a warning from clang-tools? I'm hesitant to say this is a good practice. I see this in clang-tidy, but IDK if that's really an idiomatic way to handle it. https://github.com/llvm/llvm-project/blob/c091dd48008ba6d85aee68227077ee05daeb7ca7/clang-tools-extra/clang-tidy/tool/ClangTidyMain.cpp#L640

In clang or LLVM, we'd normally use one of the Reports APIs, but I don't think we have access to those in clang-doc. not sure what the right thing to do here is.

Also,  think we normally use lower-case `warning:`.

https://github.com/llvm/llvm-project/pull/93928


More information about the cfe-commits mailing list