[clang-tools-extra] [clang-doc] Refactor error handling to use ExitOnError (PR #141699)

Samarth Narang via cfe-commits cfe-commits at lists.llvm.org
Thu May 29 03:33:15 PDT 2025


snarang181 wrote:

@ilovepi -- In the updated version, I have used the `createFileError()` API and checked that the output is reliable. Also, I have renamed the lit test file; in the tests, I create a temporary file using `%t` and then obviously, it cannot create a directory there. Hopefully that is a reliable way of testing and we are not hardcoding any paths like `/root` or `/dev` which are not portable, also not changing permissions, which you were concerned about. 
The second test I have added in the test file is of a bad format option; however, the `ExitOnErr` handler never gets invoked because I believe this is parsed earlier and reported as an error already. 

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


More information about the cfe-commits mailing list