https://github.com/Rajveer100 created https://github.com/llvm/llvm-project/pull/98129
Resolves #97983 >From e20e592845a1de4282e7492bec2e2b34ac3b96cf Mon Sep 17 00:00:00 2001 From: Rajveer <rajveer.develo...@icloud.com> Date: Tue, 9 Jul 2024 13:58:20 +0530 Subject: [PATCH] [clang][doc] Improve error handling for `LibTooling` example code avoiding core dump Resolves #97983 --- clang/docs/LibTooling.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/docs/LibTooling.rst b/clang/docs/LibTooling.rst index 87d84321ab283..c6687fb9642f9 100644 --- a/clang/docs/LibTooling.rst +++ b/clang/docs/LibTooling.rst @@ -75,7 +75,7 @@ and automatic location of the compilation database using source files paths. auto ExpectedParser = CommonOptionsParser::create(argc, argv, MyToolCategory); if (!ExpectedParser) { // Fail gracefully for unsupported options. - llvm::errs() << ExpectedParser.takeError(); + llvm::errs() << toString(ExpectedParser.takeError()); return 1; } CommonOptionsParser& OptionsParser = ExpectedParser.get(); @@ -142,7 +142,7 @@ version of this example tool is also checked into the clang tree at int main(int argc, const char **argv) { auto ExpectedParser = CommonOptionsParser::create(argc, argv, MyToolCategory); if (!ExpectedParser) { - llvm::errs() << ExpectedParser.takeError(); + llvm::errs() << toString(ExpectedParser.takeError()); return 1; } CommonOptionsParser& OptionsParser = ExpectedParser.get(); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits